<![CDATA[ mxfb & MODX 2.3.x - quick fix for Users and Contexts superboxselect - My Forums]]> https://forums.modx.com/thread/?thread=95635 <![CDATA[mxfb & MODX 2.3.x - quick fix for Users and Contexts superboxselect]]> https://forums.modx.com/thread/95635/mxfb-modx-2-3-x---quick-fix-for-users-and-contexts-superboxselect#dis-post-517606
Anywhere you find
url: MODx.config.connector_url+'folder/some_connector.php',
baseParams: { action: 'getlist'},


you will need to change to
    	,url: MODx.config.connector_url
        ,baseParams: {
            action: 'folder/some_connector/getlist'
        }


This is due to the way 2.3 handles connectors from what I have gathered on the forums.

Another thing that has to change for the SuperBoxSelect to show up properly in mxfb is the class.

        ,clearBtnCls: 'x-form-trigger'
        ,expandBtnCls: 'x-form-trigger'

needs to be added (and any other old tagClass needs to be removed) so that the select box renders properly in 2.3.

Here is my refactored code to get the Users superselectbox working in 2.3:
MODx.combo.Users = function (config, getStore) {
    config = config || {};
    Ext.applyIf(config, {
        name: 'fake_users'
        ,hiddenName: 'fake_users'
        ,valueField: "id"
        ,displayField: "username"
        ,mode: 'remote'
        ,triggerAction: 'all'
        ,typeAhead: true
        ,editable: true
        ,forceSelection: false
        ,clearBtnCls: 'x-form-trigger'
        ,expandBtnCls: 'x-form-trigger'
    	,xtype:'superboxselect'
    	,url: MODx.config.connector_url
        ,baseParams: {
            action: 'security/user/getlist'
        }
        ,fields: ['username', 'id']
    });
    Ext.applyIf(config,{
        
	store: new Ext.data.JsonStore({
	    url: config.url
            ,root: 'results'
            ,fields: config.fields
            ,errorReader: MODx.util.JSONReader
            ,baseParams: config.baseParams || {}
            ,remoteSort: config.remoteSort || false
            ,autoDestroy: true
	,listeners: {
                    'load': {fn:function(store, records, options ) {
                    }}
                    ,scope : this
                }
	})
        ,listeners: {
            'beforeselect': {fn:function(combo, record, index ) {
                if (record.data.is_parent == '1'){
                    return false;
                }
            }}
            ,scope : this
        }  
    });
    if (getStore === true) {
        config.store.load();
        return config.store;
    }
    MODx.combo.Users.superclass.constructor.call(this, config);
    this.config = config;
    return this;
};
Ext.extend(MODx.combo.Users, Ext.ux.form.SuperBoxSelect);
Ext.reg('modx-superbox-user', MODx.combo.Users);
]]>
dvstudiosinc Dec 28, 2014, 09:55 PM https://forums.modx.com/thread/95635/mxfb-modx-2-3-x---quick-fix-for-users-and-contexts-superboxselect#dis-post-517606