We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11283
    • 11 Posts
    Hello there,

    i am not sure if this is the right topic to post it...

    Following problem: I get a value of 0 - 3 from the method getList.php (connection to a database). The dropdown menu should have four possible selections: Radiobuttons, Checkboxes, Textfield and Textarea. If the returned value of the getList method is for example: 2 -> it shows the name ’Textfield’.

    Currently it only shows the returned value and i am not able to make a selection. ->

    Polls.combo.TypeList = function(config) {
    config = config || {};
    Ext.applyIf(config, {
    name: ’type’,
    hiddenName: ’type’,
    typeAhead: true,
    triggerAction: ’all’,
    lazyRender:true,
    valueField: ’myID’,
    displayField: ’displayText’,
    fields: [’myID’,’displayText’],
    data: [[0, ’Radiobuttons’], [1, ’Checkboxes’], [2, ’Textfield’], [3, ’Textarea’]],
    url: Polls.config.connector_url,
    baseParams: {

    action: ’mgr/questions/getlist’,
    combo: true
    }
    });

    Polls.combo.TypeList.superclass.constructor.call(this, config);
    };

    Ext.extend(Polls.combo.TypeList, MODx.combo.ComboBox);
    Ext.reg(’polls-combo-types’, Polls.combo.TypeList);

    I hope you can help me. I want to improve the new Poll Tool.

    Best regards,

    greenvisions
      • 28215
      • 4,149 Posts
      Question:

           valueField: 'myID',
            displayField: 'displayText',
            fields: ['myID','displayText'],
            data: [[0, 'Radiobuttons'], [1, 'Checkboxes'], [2, 'Textfield'], [3, 'Textarea']],
            url: Polls.config.connector_url,
            baseParams: {
                    action: 'mgr/questions/getlist',
               combo: true
              }
      

      Why do you have *both* data: and url: parameters? You only need one. Are you trying to do a local store combobox? If so, set mode: ’local’ and drop the url/baseParams parts.
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 11283
        • 11 Posts
        Thank you works great!

        I used the store and mode:"local" before, but something went wrong. Everytime the first option was selected, although the selected value was 2 or 3.

        But now it works laugh

        best regards,

        greenvisions