Results 1 to 3 of 3

Thread: How to get value of a combobox in a proxy store?

  1. #1
    Sencha User
    Join Date
    Sep 2012
    Posts
    48
    Vote Rating
    1
      0  

    Default How to get value of a combobox in a proxy store?

    I have a store that sends a parameter to my controller. When I define my store

    Code:
        proxy: {
                    type: 'ajax',
                    scope: this,
                    url: 'My/GetData',
                    extraParams: {
                        parametervalue: Ext.getCmp('Combo').getValue() //something similar
                       }
              }
    I am not updating the store on combo selection. Or else I could have just added a listener on combo and updated the store.
    I want to get the value of the combobox when the grid is loaded. It also works with paging, so when the user hits next page the store loads the second page "with" the selected value in the combobox, which it passes to my controller.

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,556
    Answers
    3932
    Vote Rating
    1272
      1  

    Default

    So the store is already created so the getValue is going to happen too soon correct? You could have a beforeload event listener to add in a param.

    Or when the change event fires on the combo, add that value to the extraParams of the store.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Sep 2012
    Posts
    48
    Vote Rating
    1
      0  

    Default

    Hi Mitchell... thanks for your response... i think i know what you are talking about but not sure how to go about doing that on extjs... m totally new to this.. could you please show me an example of what you just explained... i'd really appreciate... thanks
    Quote Originally Posted by mitchellsimoens View Post
    So the store is already created so the getValue is going to happen too soon correct? You could have a beforeload event listener to add in a param.

    Or when the change event fires on the combo, add that value to the extraParams of the store.

Tags for this Thread

Posting Permissions

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