Results 1 to 10 of 11

Thread: extraParams for JSON store

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    60
    Vote Rating
    1
      0  

    Question extraParams for JSON store

    Hi,

    I'm happily using Ext Designer 1.2.2 build 48 for building up my GUI. At the moment I'm stuck with the neccessarity of using extraParams in a store definition: I need to pass the values of some other components which I need for the dynamic store logic. In a manually built app, I added the following definition to the store:
    Code:
                    extraParams: { 
                    'sessionId': Ext.state.Manager.get('sessionId'),
                    'searchName': Ext.ComponentManager.get('searchFullname').getValue(),
                    'searchDepartment': Ext.ComponentManager.get('searchDepartment').getValue(),
                    'searchLocation': Ext.ComponentManager.get('searchLocation').getValue(),
                    'searchCompany': Ext.ComponentManager.get('searchCompany').getValue()
                    },
    Since Ext Designer supports the extraParams definition as an "[object]" definition and I cannot check out how the formatting of this is: how to paste the above code snippet into the "extraParams" field for my store without messing the syntax? It seems that every singletick will be escaped by a backslash. Any hints are welcome.

    Regards,
    Harald

  2. #2
    Sencha User
    Join Date
    Oct 2011
    Posts
    50
    Vote Rating
    2
      0  

    Default Same issue

    The extraParams field appears to be a bit flaky. For example, entering in the following works correctly;

    {a: 'b'}

    However, entering this does not

    {
    a: 'b',
    b: someVar
    }

    I am unsure as to why, anybody have any thoughts?

  3. #3
    Sencha User
    Join Date
    Oct 2011
    Posts
    50
    Vote Rating
    2
      0  

    Default

    I found a potential work around.

    Steps:
    1. Set your store to autoLoad: false;
    2. In your application js, the following code sets extra params by hand;

    Code:
    var gridDataStore = Ext.getStore('GridDataStore');
    var extraParams = gridDataStore.getProxy().extraParams;
    extraParams.param1 = 'value1'
    extraParams.param2 = someFunction();
    gridDataStore.load();
    Maybe this approach would work for you as well?

  4. #4
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    60
    Vote Rating
    1
      0  

    Default

    This sounds for an approach I can live with (until the designer will be able to better handle these addition parameters). Thanks for the great input.

  5. #5
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,487
    Vote Rating
    146
      0  

    Default

    The extraParams configuration currently only supports you putting raw objects in there with simple type values. (no variables or functions)

    Code:
    {
       a: 'aasf',
       b: true
    }
    Will work fine, but you cannot invoke methods and/or pass variables.
    Aaron Conran
    @aconran

  6. #6
    Sencha User
    Join Date
    Oct 2011
    Posts
    50
    Vote Rating
    2
      0  

    Default

    Quote Originally Posted by aconran View Post
    The extraParams configuration currently only supports you putting raw objects in there with simple type values. (no variables or functions)

    Code:
    {
       a: 'aasf',
       b: true
    }
    Will work fine, but you cannot invoke methods and/or pass variables.
    Thanks Aaron,

    Any chance of getting this information added to the docs? I'm not seeing it in the overlay help in the Designer or here: http://docs.sencha.com/ext-js/4-0/#!...fg-extraParams

Posting Permissions

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