Results 1 to 3 of 3

Thread: Bring in value from one combobox to a second combobox to send as a param

  1. #1

    Default Bring in value from one combobox to a second combobox to send as a param

    I want to use the selected value from a combobox as a parm on another combobox. I can get the value selected and assign it to variable. My problem is using that value as a parm on the next combbox. I've tried a lot of different examples and nothing seems to work. Thanks for any help. My code is below.

    Code:
    xtype:'combo',                    id:'add_MTMAJMIN',
    
                        fieldLabel:'Stop Level',
                        emptyText: 'Select Level',
                        selectOnTab: true,
                        triggerAction: 'all',
                        editable: false,
                        forceSelection:true,
                        selectOnFocus: true,
                        valueField: 'text',                   
                        displayField: 'text',
                        mode: 'local',
                        store: new Ext.data.SimpleStore({
                            fields: ['text'],
                            data: [['Major'], ['Minor']]
                         }),
                         listeners: {
                             scope : this,
                            select: function MajMin_Select (combo, record, index)
                             {
     var svmajmin = combo.getValue();
    // alert("majmin: " + svmajmin);
                            }
                         }         
    
    Code:
    xtype:'combo',
                        id:'add_MTREASON',
                        fieldLabel:'Reason',
                        emptyText: 'Select Reason',
                        selectOnTab: true,
                        triggerAction: 'all',
                        editable: false,
                        forceSelection:true,                   
                        valueField: 'DRREASON',                   
                        displayField: 'DRREASON',                    
                        store: new Ext.data.JsonStore({
                            url: 'vvcall.pgm',
                            fields: ['DRREASON'],
                            root: 'REASON',
                            autoLoad: false,
                             baseParams: {
                                 action: 'getReasons',
                                pgm: 'GETREASON',
                                 tbmajmin: svmajmin.getValue()
                             }
                         })
    

  2. #2
    Sencha User joel.watson's Avatar
    Join Date
    Nov 2014
    Posts
    3,120
    Answers
    446

    Default

    Hi--

    You could add an extraParam to the second combo's proxy when the first combo's value changes, or even add a beforequery listener to the second combobox and influence the proxy there based on the value of the first combobox.

    Thanks!
    Joel

  3. #3
    Sencha User jdkhamba's Avatar
    Join Date
    Jul 2012
    Posts
    236
    Answers
    45

    Default

    You can set the extraParams in the second combo using setProxy of the combo's store.

    Take a look:
    https://fiddle.sencha.com/#fiddle/vkl

Similar Threads

  1. send param to php in form
    By myput in forum Sencha Touch 1.x: Q&A
    Replies: 4
    Last Post: 5 Dec 2011, 8:51 AM
  2. JsonStore: send a param only once
    By alexw23 in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 19 Jul 2010, 1:51 PM
  3. Update Param in after created and bound to combobox
    By newedge in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 8 Dec 2008, 11:07 AM
  4. Replies: 4
    Last Post: 1 Apr 2008, 10:08 PM
  5. send param with AJAX
    By fernandoamorim in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 16 Feb 2008, 6:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •