We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1778
    • 659 Posts
    Hi all
    In a Custom Component CMP with grid and create/update window, Is there a way to set a combo to be 'dynamic' ? ie : allowing user to type few lettersin the combofield and then have the store to start with elements matching the letters entered ?
    Thanks
    Cheers [ed. note: anso last edited this post 14 years, 3 months ago.]
      • 33976 ☆ A M B ☆
      • 571 Posts
      Hi wink

      typeAhead is probably what you are looking for

      Hope that will help
        • 1778
        • 659 Posts
        Hi again Romain ^_^

        I tried 'typeAhead:true', but it does not allow to type anything in the combo... I tried together
        "typeAhead:true, editable:true" -> it allows to type into the combo does not do anything else...
        If you have any other idea...
        Cheers
          • 33976 ☆ A M B ☆
          • 571 Posts
          So far, no real idea beside giving you an example i'm using :

          /**
           * @class Class.combo.name
           * @extends MODx.combo.ComboBox
           * @param {Object} config
           * @xtype class-combo-name
           */
          Class.combo.name = function(config) {
              config = config || {};
          
              Ext.applyIf(config, {
                  name : 'field'
                  ,hiddenName : 'field'
                  ,pageSize: 10
                  ,forceSelection: true
                  ,selectOnFocus: true
                  ,displayField : 'name'
                  ,valueField : 'id'
                  ,fields: ['id', 'name']
                  ,triggerAction : 'all'
                  ,lazyRender: true
                  ,editable : true
                  ,typeAhead: true
                  ,minChars: 1
                  ,allowBlank: false
                  ,url: Class.config.connector_url
                  ,listWidth: 0
                  ,baseParams: {
                      action: 'mgr/action/getlist'
                      ,combo: true
                  }
              });
              Class.combo.name.superclass.constructor.call(this, config);
          };
          Ext.extend(Class.combo.name, MODx.combo.ComboBox);
          Ext.reg('class-combo-name', Class.combo.name);
          


          Hoping you'll find some clue here smiley

          Good luck
            • 1778
            • 659 Posts
            Thanks Romain,
            You're my kind of genius in bottle today ^_^ works like a charm...Did not find where was my mistake, but just copy/paste your code and change it to fit with my settings and all is fine...
            Thanks again
            Cheers
            Have swing