Results 1 to 6 of 6

Thread: Where did setBaseParam go in ExtJS 4?

  1. #1
    Sencha User
    Join Date
    Nov 2011
    Posts
    5
    Vote Rating
    0
      0  

    Default Where did setBaseParam go in ExtJS 4?

    Hi All,

    I'm switching to ExtJS 4 from 3 and noticed that setBaseParam is missing under proxy.

    So where did setBaseParam go in ExtJS 4?

    When I look at the documentation for load() function in ExtJS 4, it says that it expects a config object of Ext.data.Operation wich doesn't say it supports 'params' config.

    So what is the workaround?

  2. #2
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,026
    Vote Rating
    1367
      0  

    Default

    There are no base params. The proxy has extraParams that is the same thing.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  3. #3
    Sencha User
    Join Date
    Nov 2011
    Posts
    5
    Vote Rating
    0
      0  

    Default

    Yes, I noticed that. There would still be handy to have something like setExtraParams() to add params to the request.

    If someone is looking for the same thing the following does the trick:

    store.getProxy().extraParams.someparameter1 = newValue1;
    store.getProxy().extraParams.someparameter2 = newValue2;

    Source: http://www.sencha.com/forum/archive/...t-145757.html?

  4. #4
    Sencha User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,026
    Vote Rating
    1367
      0  

    Default

    I do this a lot:

    Code:
    Ext.apply(store.proxy.extraParams, {
        foo : 'bar'
    });
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  5. #5
    Sencha User aiky.cc's Avatar
    Join Date
    Aug 2012
    Location
    Novokuznetsk, Russia
    Posts
    40
    Vote Rating
    -2
      0  

    Default

    Mitchell, and what about:

    Code:
     
    Ext.apply(store.proxy.extraParams, {     
      'foo' :{
          'foofoo':'bar',
          'arr':[1,2,3]
      }
    });
    So, how to add multi-dimensional hashes/arrays?

  6. #6
    Sencha User aiky.cc's Avatar
    Join Date
    Aug 2012
    Location
    Novokuznetsk, Russia
    Posts
    40
    Vote Rating
    -2
      0  

    Default

    ??, I was found next way for 4.1.x:

    Code:
    var data = ['foo','ofo','oof'];
    for(var i = 0; i < data.length; i++) store.proxy.setExtraParam('data[' + i + ']',data[i] );
    but why not simple applyEncoding before buildRequest for extraParams at Ext.data.proxy.Server, source code:
    Code:
    buildRequest: function(operation) {         
      var me = this, 
      params = operation.params = Ext.apply({}, operation.params, me.extraParams)
     ...
    as it makes for sorters and filter params, why not?

Posting Permissions

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