I'm not sure if this is what you mean BUT look in 'manager/assets/modext/core/modx.view.js'. The MODx browser window has an 'openTo' config setting that controls which directory the browser tree/view expand/open to when launched.
You can add the 'openTo' setting to the modx-combo-browser object
{
xtype: 'modx-combo-browser'
,fieldLabel: _('pm.item')
,name: 'url'
,id: 'pm-'+Ext.id()+'-url'
,allowBlank: false
,openTo: 'assets/resources/images/'
,hideFiles: true
//,width: 300
}
or extend/override the orignal objects - don't imagine it would take much to pass a value from an event.
MODx.combo.Browser = function(config) {
config = config || {};
Ext.applyIf(config,{
width: 300
,triggerAction: 'all'
});
MODx.combo.Browser.superclass.constructor.call(this,config);
this.config = config;
};
Ext.extend(MODx.combo.Browser,Ext.form.TriggerField,{
browser: null
,onTriggerClick : function(btn){
if (this.disabled){
return false;
}
if (this.browser === null) {
this.browser = MODx.load({
xtype: 'modx-browser'
,id: Ext.id()
,multiple: true
,prependPath: this.config.prependPath || null
,prependUrl: this.config.prependUrl || null
,basePath: this.config.basePath || ''
,basePathRelative: this.config.basePathRelative || null
,baseUrl: this.config.baseUrl || ''
,baseUrlRelative: this.config.baseUrlRelative || null
,hideFiles: this.config.hideFiles || false
,rootVisible: this.config.rootVisible || false
,allowedFileTypes: this.config.allowedFileTypes || ''
,wctx: this.config.wctx || 'web'
,openTo: this.config.openTo || 'assets/resources/images/'
,listeners: {
'select': {fn: function(data) {
this.setValue(data.relativeUrl);
this.fireEvent('select',data);
},scope:this}
}
});
}
this.browser.show(btn);
return true;
}
,onDestroy: function(){
MODx.combo.Browser.superclass.onDestroy.call(this);
}
});
Ext.reg('modx-combo-browser',MODx.combo.Browser);
[ed. note: simonp98 last edited this post 12 years, 5 months ago.]