• 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.

[SOLVED] Force Combo Box to always reload

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

  • [SOLVED] Force Combo Box to always reload

    I have found several examples but I cannot get it to work. Here is my combo box code.

    Code:
                            xtype: 'combo',
                            id: 'EVENT',
                            fieldLabel: 'Activity',
                            triggerAction: 'all',
                            emptyText: 'Select Activity...',
                            editable: false,
                            forceSelection: true,
                            valueField: 'EMEVENT',
                            displayField: 'EMNAME',
                            store: dsEvents,
                            mode: 'remote',
                            listeners: {
                                beforequery: function(qeb){
    								delete qeb.dsEvents.lastQuery;
    							},
    							select: function(){
                                    dsUsers.reload();
                                    SaveEVENT = Ext.getCmp('EVENT').getValue();
                                }
                            }
    When I run my code I get the following error: qeb.dsEvents is undefined

    I have seen an example use "qe" instead of "qeb". But I get the same error.

    What is the correct syntax?

    Thanks in advance.

  • #2
    I'd guess that the example you copied from had the store in a variable called 'dsEvents'.

    The beforequery listener function would pass the combo in its first parameter, so you have a handle on the store by saying qeb.getStore().

    Try:
    Code:
     delete qeb.getStore().lastQuery;

    Comment


    • #3
      Actually, I just noticed that dsEvents is your store. So the code I wrote above should work, but you could also just do delete dsEvents.lastQuery.

      dsEvents is a variable defined as the store, but when you say qeb.dsEvents it looks for a property on your combo called dsEvents. In your case, you have a property on your combo called store with a value of dsEvents.

      Comment


      • #4
        Actually, I just reviewed the API. For beforequery, the parameter to the listener funciton is actually an object!

        Therefore, to get to the combo, you'd have to do qeb.combo.

        So your code could be:

        Code:
        delete qeb.combo.getStore().lastQuery;
        
        //or simply 
        delete.dsEvents.lastQuery;

        Comment


        • #5
          I changed my code for the combo box. Here is the latest version.

          Code:
                                  xtype: 'combo',
                                  id: 'EVENT',
                                  fieldLabel: 'Activity',
                                  triggerAction: 'all',
                                  emptyText: 'Select Activity...',
                                  editable: false,
                                  forceSelection: true,
                                  valueField: 'EMEVENT',
                                  displayField: 'EMNAME',
                                  store: dsEvents,
                                  mode: 'remote',
                                  listeners: {
                                      beforequery: function(qeb){
          								delete dsEvents.lastQuery;
          							},
          							select: function(){
                                          dsUsers.reload();
                                          SaveEVENT = Ext.getCmp('EVENT').getValue();
                                      }
                                  }
          I do not get an error when I load the page. It goes back to the server and loads the combo box the first time. I make my selection and everything works as expected. I then click on the combo box and it does not load the combo box again. It displays the original combo box again.

          I also tried with qeb.combo.getStore().lastQuery and I get the same behavior as above.

          Any other suggestions?

          Thanks in advance.

          Comment


          • #6
            What behavior do you expect from the combo box on the second reload?

            Comment


            • #7
              I expect to see a call back to the server in Firebug. I do not.

              The user should see the Loading message while the call back to the server is executed likes it does when the first call is made.

              Comment


              • #8
                GordS, We spoke on the phone a few months back, I am assuming that this issue and some of your others are no longer issues for you. I believe this one was working properly once we cleaned up some of the references.

                Comment


                • #9
                  This problem has not been resolved. We are just living with the problem at the moment.

                  Comment


                  • #10
                    Did you do anything to work around it, or it is still an issue?

                    Comment


                    • #11
                      I could not figure out a work around. It is still an outstanding issue.

                      Comment


                      • #12
                        Let's get this one resolved. We can hop on the phone if we need to. Let's try for tomorrow. Does that work for you?

                        Comment


                        • #13
                          I led GordS in the wrong direction. THe fix here was to delete the lastQuery from the combo, not the store!
                          Code:
                          delete qeb.combo.lastQuery;

                          Comment

                          Working...
                          X