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

Thread: extraParams for JSON store

  1. #1
    Ext JS Premium Member
    Join Date
    May 2011
    Posts
    56
    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
    56
    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
    145
      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

  7. #7
    Sencha User
    Join Date
    Nov 2011
    Posts
    28
    Vote Rating
    0
      0  

    Default

    hi,

    is there already a workarround for this ? today i have tested the designer 2 and got the same problem,
    only raw data is accepted ;-(( i would like to use functions wherevery the parameters accept objects or arrays.
    any news about this ?

    thank you,
    micha

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

    Default

    Quote Originally Posted by thantous View Post
    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
    Those are the SDK docs. We are working on the Designer docs which will be available when we GA the product. Information about adding custom properties is already in there.
    http://docs.sencha.com/designer/2-0/#!/guide
    Aaron Conran
    @aconran

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

    Default

    Quote Originally Posted by michabbb View Post
    is there already a workarround for this ? today i have tested the designer 2 and got the same problem,
    only raw data is accepted ;-(( i would like to use functions wherevery the parameters accept objects or arrays.
    any news about this ?
    You can implement an override for the class you are working with.
    Aaron Conran
    @aconran

  10. #10
    Sencha User
    Join Date
    Nov 2011
    Posts
    28
    Vote Rating
    0
      0  

    Default

    thank you, good hint, is there somewhere a simple example for such an override ?

Page 1 of 2 12 LastLast

Posting Permissions

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