We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 31053
    • 31 Posts
    Hi. I have Manager Menu with grid.
    How can I add combo box like combo-box in select default template in system settings?

    Thank you.
      for($i=0; $i<100; $i++) echo &#39;Why is it not working?&#39;;
      • 33983 ☆ A M B ☆
      • 181 Posts
      Here is how to create a local data combo box, it worked for me anyway.
      YourCMPName.combo.myComboName = function(config) {
          config = config || {};
          Ext.applyIf(config,{
             //displayField: 'name'
              //,valueField: 'id'
              //,fields: ['id', 'name']
              //,url: YourCMPName.config.connectorUrl
              store: ['approved','hidden','pending','auto_approved']// this is the local values
              ,baseParams: { action: '' ,combo: true }
              ,mode: 'local'
              ,editable: false
          });
          YourCMPName.combo.myComboName.superclass.constructor.call(this,config);
      };
      Ext.extend(YourCMPName.combo.myComboName,MODx.combo.ComboBox);
      Ext.reg('myComboName-combo', YourCMPName.combo.myComboName);
      


      Now in your grid js:
             {
                  header: _('YourCMPName.status')
                  ,dataIndex: 'status'
                  ,sortable: true
                  ,width: 60
                  // textfield: ,editor: { xtype: 'textfield' }
                  // this is a Yes/no: ,editor: { xtype: 'combo-boolean' ,renderer: 'boolean' }
                  ,editor: { xtype: 'myComboName-combo', renderer: true }
              },