We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38878
    • 255 Posts
    Can anyone explain to me how to get the current value of a combobox to display in the grid on load instead of the value? I've read 42 different posts on it but it all seems so cloogey. My box:
    Recroot.combo.Companies = function(config) {
        config = config || {};
        Ext.applyIf(config,{
        xtype:'combobox'
        ,store: new Ext.data.JsonStore({
            url: Recroot.config.connectorUrl,
            // store configs
            autoDestroy: false,
            baseParams: {
                action: 'mgr/company/getlist',
                combo: true
            },
            storeId: 'companyStore',
            // reader config
            mode: 'local',
            root: 'results',
            idProperty: 'id',
            autoLoad: true,
            valueNotFoundText: 'Entry not found',
            fields: ['id', 'name']
        })
        ,displayField: 'name'
        ,valueField: 'id'
        ,emptyText: 'Company...'
        });
        Recroot.combo.Companies.superclass.constructor.call(this,config);
    };
    Ext.extend(Recroot.combo.Companies, MODx.combo.ComboBox);
    Ext.reg('Companies-combo', Recroot.combo.Companies);


    And my grid column:
    {
                header:_('recroot.position_header_company')
                ,dataIndex: 'company'
                ,sortable: true
                ,width: 50
                ,displayField: 'name'
                ,editor: { xtype: 'Companies-combo', renderer:'true' }
            }
      • 44195
      • 293 Posts
      Not sure exactly what you mean when you say current value instead of the value?
        I'm lead developer at Digital Penguin Creative Studio in Hong Kong. https://www.digitalpenguin.hk
        Check out the MODX tutorial series on my blog at https://www.hkwebdeveloper.com