• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

ComboBox Autocomplete

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ComboBox Autocomplete

    How is the "queryParam:" used in association with the autocomplete combobox

    Extjs doc says it defaults to 'query', but I dont understand how it would be used in the RPG program, and what would be used as a param?

    TIA ...

  • #2
    The queryParam is simply the field name that is automatically embedded into the ajax call to the RPG program. The data on that field is just the current value of the combobox as you type. In the typeahead combobox example that comes with Valence we override that behavior by setting a beforeload listener. To make it more clear for you I modified that example to use the standard query behavior and I set the queryParam name to be cname because this is the field name that the RPG program is expecting. If you were to leave this off the field name would be "query" and the RPG program would fail, unless you changed the RPG to expect the field name of query. You can change that and look at the post parms in Firebug to get a better understanding of how it works.

    Code:
    Ext.onReady(function() {
    
        // type-ahead data store
        var dsCNAME = new Ext.data.JsonStore({
            autoLoad: false,
            url: 'vvcall.pgm',
            root: 'DEMOCMAST',
            fields: ['CNAME'],
            baseParams: {
                pgm: 'excmbta',
                action: 'getSuggestion'
            }
        });
        
        var formMain = new Ext.FormPanel({
            title: 'Type Ahead Example',
            labelWidth: 100,
            frame: true,
            items: [{
                xtype: 'combo',
                fieldLabel: 'Customer Name',
                id: 'CNAME',
                width: 165,
                store: dsCNAME,
                displayField: 'CNAME',
                hideTrigger: true,
                minChars: 0,
                loadingText: 'Loading...',
                queryParam: 'cname'
            }]
        });
        
        formMain.render('formMain');
        
    });

    Comment


    • #3
      Thanx Richard

      man, that answered EXACTLY what I needed ...

      You da man ...

      Comment


      • #4
        PS, You mentioned a combobox example ...

        Which one is it? Because I looked before I posted this thread...

        Comment


        • #5
          From the portal it's /Examples/Combo Boxes/Type Ahead

          The JavaScipt is at path [valence root]/html/examples/comboboxes/typeahead.html

          Comment


          • #6
            coolBeans ...

            I love this stuff ...

            Comment

            Working...
            X