[CLOSED] Is there a way to send Store baseParams during Update

  1. #1

    [CLOSED] Is there a way to send Store baseParams during Update

    Hi,

    I'm following your example here:
    https://examples1.ext.net/#/GridPane.../Confirmation/

    In it you use an HttpWriteProxy to POST an Update request to an ASHX which is exactly what I want to do. However, watching the data in Firebug, I notice that edited/updated rows are sent to the server but that is it - I don't see the store's base params being sent to the server like they are during a load. Is there a way to get them sent during an update/save operation as well as load? I tried to look at Ext Js's save() method on the Store and couldn't see it.

    If there isn't a native way, the only other way I can see is perhaps on the Store's BeforeSave event updating the HttpWriteProxy's URL to have the store base parameters added to it as querystrings, which is a bit limited but could work in my scenario. Then I can request them off the Request object on the ashx. Can you see another way to do this?

    Thanks!
    Last edited by Daniil; Jun 14, 2011 at 9:06 AM. Reason: [CLOSED]
  2. #2
    I've used this kind of JavaScript for now:

    (I found I had to use autoLoad, not baseParams)

    beforeSave: function(store) {
        var autoLoad = store.autoLoad.params,
            params = [],
            queryString;
    
        for (param in autoLoad) {
            if (autoLoad.hasOwnProperty(param)) {
                params.push(encodeURIComponent(param) + "=" + encodeURIComponent(autoLoad[param]));
            }
        }
    
        queryString = params.join("&");
        
        store.updateProxy.conn.url += "?" + queryString;
    },
    
    // etc
    So I guess my question is am I just re-inventing the wheel and has ExtJs or Ext.Net got a way to already send the base params during an update?
  3. #3
    Hi,

    I guess you need to use <WriteBaseParams> of Store.
  4. #4
    Many thanks for that! Didn't realize there was that property. That seems to do the trick :)

Similar Threads

  1. Replies: 2
    Last Post: Apr 27, 2011, 12:29 PM
  2. Get baseParams from Store in Javascript
    By Waltheer in forum 1.x Help
    Replies: 0
    Last Post: Mar 09, 2011, 12:24 PM
  3. Replies: 4
    Last Post: Dec 01, 2010, 10:48 AM
  4. [1.0 RC1] Add FileUploadField to Store's BaseParams
    By Maarten Boone in forum 1.x Help
    Replies: 0
    Last Post: Nov 13, 2010, 10:04 AM
  5. Set Store BaseParams from codebehind
    By stu in forum 1.x Help
    Replies: 2
    Last Post: Jun 22, 2010, 4:47 PM

Posting Permissions