Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Cascading Combobox no longer working

  1. #1
    Sencha User
    Join Date
    Jan 2010
    Posts
    168

    Default Cascading Combobox no longer working

    I have a cascaded combobox on a form that works on select and save of the form, but when you pull the form back up, the display of the cascaded combo just shows the id value and not the name value. This used to work and just stopped working. I did throw in the 3.3B2 library recently and will roll back, but thought i would get this posted.

    Combo 1 selects a Mill. Upon selection of the mill the Contact combobox filters contacts for that mill by Name and when the form is saved, the keyid value(hiddenName) for the Contact is saved.

    This works fine and when the form is reloaded the MillName is present, but the keyid value shows in the cascaded/linked box instead of the linked name:

    Code:
                    },{
                         xtype: 'combo'
                        ,editable: false
                        ,width:300
                        ,fieldLabel: 'Mill'
                        ,name: 'comboMill'
                        ,displayField:'millName'
                        ,valueField: 'millID'
                        ,hiddenName: 'millID'
                        ,triggerAction:'all'
                        ,store: {
                            xtype: 'jsonstore'
                            ,url: '?c=lookup&m=mills'
                            ,fields: ['millID','millName']
                            ,autoLoad:false
                        }
                        ,listeners:
                                {select: {
                                    fn: function(combo,record,value)
                                    
                                    {
                                        var conbox = Ext.getCmp('contact');
                                        conbox.clearValue();
                                        conbox.store.load({
                                            params:{
                                                millID: record.data.millID
                                            }
                                        }); 
                                    }
                                }}  
                    },{
                         xtype: 'combo'
                        ,editable: false
                        ,width:300
                        ,id: 'contact'
                        ,fieldLabel: 'Contact'
                        ,name: 'comboContact'
                        ,displayField:'conName'
                        ,valueField: 'conID'
                        ,hiddenName: 'conID'
                        ,triggerAction:'all'
                        ,mode: 'local'
                        ,store: {
                            xtype: 'jsonstore'
                            ,url: '?c=lookup&m=contacts'
                            ,fields: ['conID','conName']
                            ,autoLoad:false
                        }  
                    }]

  2. #2
    Sencha User
    Join Date
    Jan 2010
    Posts
    168

    Default

    I rolled back to 3.2 and same result. What is interesting is if I change the Contact name and save the form. All the records with that contact display properly (because it is currently loaded)?

  3. #3
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    The store of the second combobox needs to contain the text for the value you are setting.

  4. #4

    Default

    Does anyone know any extension for multi-level combobox (something like drop-down menu) rather than 2 different cascading selectboxes?

  5. #5
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    The Simple Tasks example in the ext-air package contains a TreeSelector component (doesn't require Air).

    Animal also created a component that does the same (see the user extensions forum).

  6. #6
    Sencha User
    Join Date
    Jan 2010
    Posts
    168

    Default Text for second combo

    The store does contain the text of the name. I have even set the store to autoload to make sure it is there in advance and it still has same result.

    the store does contain the text conName. Am I missing your point?

  7. #7
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    Loading is asynchronous. Are you SURE the store is loaded before you set the value?

    If not then try this override.

  8. #8
    Sencha User
    Join Date
    Jan 2010
    Posts
    168

    Default JSON data returns value

    I can see the JSON data and the store is loaded prior to rendering the form . I will try the override.

    Thanks.

  9. #9
    Sencha User
    Join Date
    Jan 2010
    Posts
    168

    Default Override - not working

    I added the override to a file called overrides.js which I load after I load the main EXT and UX.js files. Is there something else I should be doing?

  10. #10
    Sencha User
    Join Date
    Jan 2010
    Posts
    168

    Default Starting to see the light

    Your right about the store loading. It loads when I choose the superseding combo and filters it right there. Therfore any record with that value shows but not the others. Although, when I choose a record that is bound to the form, I also have the conName.

    Perhaps my implementation of the cascaded combo is not a good one for form bound records?

Page 1 of 2 12 LastLast

Similar Threads

  1. [2.2][FIXED] DateField disabledDates no longer working
    By maggiesnyder in forum Ext 2.x: Bugs
    Replies: 9
    Last Post: 23 Dec 2010, 2:47 PM
  2. Combobox no longer working (after upgrading from 2.x to 3.3)
    By jd2 in forum Ext 3.x: Help & Discussion
    Replies: 4
    Last Post: 9 Aug 2010, 3:59 AM
  3. Cascading combo - Store.filterby not working first time
    By SurajSrinivasan in forum Ext 3.x: Help & Discussion
    Replies: 6
    Last Post: 18 Jun 2010, 7:17 AM
  4. Tree Menu no longer working 1.0a
    By alanwilliamson in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 22 Feb 2007, 9:12 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
  •