1. #1
    Sencha Premium Member
    Join Date
    Jun 2008
    Posts
    36
    Vote Rating
    0
    supercharge2 is on a distinguished road

      0  

    Default Unanswered: Combo box with local store

    Unanswered: Combo box with local store


    I have some forms that get loaded from a database. The end user clicks on table records and these forms get loaded. Standard stuff. I have one client that is occasionally getting either an empty combo box or a combo box with partial data. The strange part is that these are local store combo box's so there is no database loading. I expect to have the information in those boxes available all the time since they don't need to go back to the database and there shouldn't be time delays or time outs. One of the combo boxes has even loaded one piece of the data array which is odd, so out of a list of 7 days of the week only Thursday is showing for some reason. In all cases they can log out and back in and it is corrected. Just wondering if anyone has seen this behavior before. Thank you!

  2. #2
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,493
    Answers
    526
    Vote Rating
    283
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    My guess is that the store is getting filtered. It could be a misconfiguration on the combobox or a shared store problem.

  3. #3
    Sencha Premium Member
    Join Date
    Jun 2008
    Posts
    36
    Vote Rating
    0
    supercharge2 is on a distinguished road

      0  

    Default Thank you

    Thank you


    I believe you are right. Further investigation show that once those combo boxes are empty or only show parshal records, even changing to other records doesn't reset them. Only a log out and back in (that reloads the code) fixes it. My thought is to reload the combo box's with loadData on every record change, any thoughts on a more efficient solution? You mention filter, I will look at the API, thank you for you feedback.

  4. #4
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,493
    Answers
    526
    Vote Rating
    283
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    You need to isolate the bug before hacking in any kind of workaround.

    ComboBoxes with local data use filtering internally to restrict the list but that only makes sense in certain cases. It may well be that you have conflicting config options. As you haven't posted any code it's difficult to say.

  5. #5
    Sencha Premium Member
    Join Date
    Jun 2008
    Posts
    36
    Vote Rating
    0
    supercharge2 is on a distinguished road

      0  

    Default Understood

    Understood


    The form this combo box lives in is getting the following applied every record change to re-setup the form:
    Code:
    contractplaceholderPanel5.getForm().reset();
    contractplaceholderPanel5.getForm().setValues(obj);
    Here is the code for the combo box and local store:
    Code:
    var stateData = Ext.create('Ext.data.Store', {
                                        fields: ['abbr', 'name'],                                    
                                        data: [
                                                { "abbr": "AL", "name": "Alabama" },
                                                { "abbr": "AK", "name": "Alaska" },
                                                { "abbr": "AZ", "name": "Arizona" },
                                                { "abbr": "AR", "name": "Arkansas" },
                                                { "abbr": "CA", "name": "California" },
                                                { "abbr": "CO", "name": "Colorado" },
                                                { "abbr": "CT", "name": "Connecticut" },
                                                { "abbr": "DE", "name": "Delaware" },
                                                { "abbr": "DC", "name": "District of Columbia" },
                                                { "abbr": "FL", "name": "Florida" },
                                                { "abbr": "GA", "name": "Georgia" },
                                                { "abbr": "HI", "name": "Hawaii" },
                                                { "abbr": "ID", "name": "Idaho" },
                                                { "abbr": "IL", "name": "Illinois" },
                                                { "abbr": "IN", "name": "Indiana" },
                                                { "abbr": "IA", "name": "Iowa" },
                                                { "abbr": "KS", "name": "Kansas" },
                                                { "abbr": "KY", "name": "Kentucky" },
                                                { "abbr": "LA", "name": "Louisiana" },
                                                { "abbr": "ME", "name": "Maine" },
                                                { "abbr": "MD", "name": "Maryland" },
                                                { "abbr": "MA", "name": "Massachusetts" },
                                                { "abbr": "MI", "name": "Michigan" },
                                                { "abbr": "MN", "name": "Minnesota" },
                                                { "abbr": "MS", "name": "Mississippi" },
                                                { "abbr": "MO", "name": "Missouri" },
                                                { "abbr": "MT", "name": "Montana" },
                                                { "abbr": "NE", "name": "Nebraska" },
                                                { "abbr": "NV", "name": "Nevada" },
                                                { "abbr": "NH", "name": "New Hampshire" },
                                                { "abbr": "NJ", "name": "New Jersey" },
                                                { "abbr": "NM", "name": "New Mexico" },
                                                { "abbr": "NY", "name": "New York" },
                                                { "abbr": "NC", "name": "North Carolina" },
                                                { "abbr": "ND", "name": "North Dakota" },
                                                { "abbr": "OH", "name": "Ohio" },
                                                { "abbr": "OK", "name": "Oklahoma" },
                                                { "abbr": "OR", "name": "Oregon" },
                                                { "abbr": "PA", "name": "Pennsylvania" },
                                                { "abbr": "PR", "name": "Puerto Rico" },
                                                { "abbr": "RI", "name": "Rhode Island" },
                                                { "abbr": "SC", "name": "South Carolina" },
                                                { "abbr": "SD", "name": "South Dakota" },
                                                { "abbr": "TN", "name": "Tennessee" },
                                                { "abbr": "TX", "name": "Texas" },
                                                { "abbr": "UT", "name": "Utah" },
                                                { "abbr": "VT", "name": "Vermont" },
                                                { "abbr": "VA", "name": "Virginia" },
                                                { "abbr": "WA", "name": "Washington" },
                                                { "abbr": "WV", "name": "West Virginia" },
                                                { "abbr": "WI", "name": "Wisconsin" },
                                                { "abbr": "WY", "name": "Wyoming" }
                                            ]
                                    });
    
    Ext.create('Ext.ux.form.field.BoxSelect', {
                                                            fieldLabel: 'States Operating In',
                                                            displayField: 'name',
                                                            valueField: 'abbr',
                                                            id: 'statesbox',
                                                            name: 'statesBox',                                                        
                                                            labelAlign: 'top',                                                        
                                                            emptyText: 'Select a State or States Operating In...',
                                                            store: stateData,
                                                            queryMode: 'local',
                                                            anchor: '50%',
                                                            columnWidth: .50,
                                                            listeners: {
                                                                'change': function (field, newValue, oldValue) {                                                                
                                                                    if (newValue == "") {
                                                                    } else {
                                                                        field.encodeSubmitValue = true;
                                                                        taxcodelistStore.getProxy().extraParams.states = newValue;
                                                                        if (taxentriesGrid.getSelectionModel().hasSelection()) {
                                                                            //console.log('true');
                                                                            var rec = taxentriesGrid.getSelectionModel().getSelection()[0];
                                                                            taxcodelistStore.load({ callback: function () { Ext.getCmp('agencystructure').setValue(rec.data.agency + rec.data.structure); } });
                                                                        } else {
                                                                            taxcodelistStore.load();
                                                                        }
                                                                    }
                                                                    //console.log(Ext.encode(field.getSubmitData()));
                                                                },
                                                                'select': function (field, records) {
                                                                    //console.log('[Select event] ' + records.length + ' records selected.');
                                                                }
                                                            }
                                                        })

  6. #6
    Sencha Premium Member skirtle's Avatar
    Join Date
    Oct 2010
    Location
    UK
    Posts
    3,493
    Answers
    526
    Vote Rating
    283
    skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future skirtle has a brilliant future

      0  

    Default


    Ah, BoxSelect, not ComboBox.

    Try it with a normal ComboBox. If you can come up with a test case for that then we can continue digging. If the problem is solely exhibited using a BoxSelect then you'll have to consult the author of that UX.

  7. #7
    Sencha Premium Member
    Join Date
    Jun 2008
    Posts
    36
    Vote Rating
    0
    supercharge2 is on a distinguished road

      0  

    Default Found it

    Found it


    Thank you for you time looking at this and your helpful comments. You initial "filter" comment kept me looking and I found my issue. The client is able to go in and "edit" previous entries in a table in this form. When they select from this table I am setting the state for that entry, but never setting the data back so the data is not there for the next record. Now that I can recreate the issue I will be able to fix it. Thanks again for you contribution.

Thread Participants: 1