We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 2292
    • 2 Posts
    yep i have done it heheheheh....but for now i have problem to include combo box i grid...any tutorial?
    thanks before
      • 33968
      • 863 Posts
      Combobox in a grid is very simple, just replace:
          ,editor: { xtype: 'textfield' }
      

      with
          ,editor: { xtype: 'modx-combo-usergroup' ,renderer: true}
      

      in your grid column where you want the combobox to appear.

      If you need to populate it with data, see the docs for how to setup your connector:
      http://rtfm.modx.com/display/revolution20/MODx.combo.ComboBox
        • 8647
        • 1 Posts
        where was the problem?
        thanks
          • 2292
          • 2 Posts
          yeah my proble now is the combo on grid not showing data from database if the page is reload

          here my code

          Supports.grid.Supports = function(config) {
          config = config || {};
          Ext.applyIf(config,{
          id: ’supports-grid-supports’
          ,url: Supports.config.connectorUrl
          ,baseParams: { action: ’mgr/supports/getList’ }
          ,fields: [’id’,’name’,’ym’]
          ,paging: true
          ,remoteSort: true
          ,anchor: ’97%’
          ,autoExpandColumn: ’name’
          ,save_action: ’mgr/supports/updateFromGrid’
          ,autosave: true
          ,columns: [{
          header: _(’id’)
          ,dataIndex: ’id’
          ,sortable: true
          ,width: 60
          },{
          header: _(’supports.name’)
          ,dataIndex: ’name’
          ,sortable: true
          ,width: 100
          ,editor: { xtype: ’textfield’ }
          },{
          header: _(’supports.ym’)
          ,dataIndex: ’ym’
          ,sortable: true
          ,width: 350
          ,editor: { xtype: ’textfield’ }
          },{
          header: _(’supports.active’)
          ,dataIndex: ’active’
          ,sortable: false
          ,width: 350
          ,editor: { xtype: ’active-combo’,renderer: true }
          }]
          ,tbar:[{
          xtype: ’textfield’
          ,id: ’supports-search-filter’
          ,emptyText: _(’supports.search’)
          ,listeners: {
          ’change’: {fn:this.search,scope:this}
          ,’render’: {fn: function(cmp) {
          new Ext.KeyMap(cmp.getEl(), {
          key: Ext.EventObject.ENTER
          ,fn: function() {
          this.fireEvent(’change’,this);
          this.blur();
          return true;
          }
          ,scope: cmp
          });
          },scope:this}
          }
          }
          ,{
          text: _(’supports.support_create’)
          ,handler: { xtype: ’supports-window-support-create’ ,blankValues: true }
          }]
          ,getMenu: function() {
          var m = [{
          text: _(’supports.support_update’)
          ,handler: this.updateSupport
          },’-’,{
          text: _(’supports.support_remove’)
          ,handler: this.removeSupport
          }];
          this.addContextMenuItem(m);
          return true;
          }
          ,updateSupport: function(btn,e) {
          if (!this.updateSupportWindow) {
          this.updateSupportWindow = MODx.load({
          xtype: ’supports-window-support-update’
          ,record: this.menu.record
          ,listeners: {
          ’success’: {fn:this.refresh,scope:this}
          }
          });
          } else {
          this.updateSupportWindow.setValues(this.menu.record);
          }
          this.updateSupportWindow.show(e.target);
          }
          ,removeSupport: function() {
          MODx.msg.confirm({
          title: _(’supports.support_remove’)
          ,text: _(’supports.support_remove_confirm’)
          ,url: this.config.url
          ,params: {
          action: ’mgr/supports/remove’
          ,id: this.menu.record.id
          }
          ,listeners: {
          ’success’: {fn:this.refresh,scope:this}
          }
          });
          }
          });
          Supports.grid.Supports.superclass.constructor.call(this,config)
          };
          //Ext.extend(Supports.grid.Supports,MODx.grid.Grid);
          Ext.extend(Supports.grid.Supports,MODx.grid.Grid,{
          search: function(tf,nv,ov) {
          var s = this.getStore();
          s.baseParams.query = tf.getValue();
          this.getBottomToolbar().changePage(1);
          this.refresh();
          }
          });
          Ext.reg(’supports-grid-supports’,Supports.grid.Supports);

          Supports.combo.active = function(config) {
          config = config || {};
          Ext.applyIf(config,{
          displayField: ’active’
          ,valueField: ’active’
          ,fields: [’active’, ’active’]
          //,url: YourCMPName.config.connectorUrl
          , store: [[’no’,’Inactive’],[’yes’,’Active’]]// this is the local values
          ,baseParams: { action: ’’ ,combo: true }
          ,mode: ’local’
          ,editable: false
          });
          Supports.combo.active.superclass.constructor.call(this,config);
          };
          Ext.extend(Supports.combo.active,MODx.combo.ComboBox);
          Ext.reg(’active-combo’, Supports.combo.active);

          Any wrong there?