PDA

View Full Version : ds.load('url') ignores parms?



mcrusty
17 Apr 2007, 10:12 AM
Using HttpProxy to load data from the server. Works great on first load of Data to server using ds.load();


ds = new Ext.data.Store({
proxy: new Ext.data.HttpProxy({
url: 'Dispatcher?&method=getGridData'}),
reader: new Ext.data.JsonReader({
root: 'result',
totalProperty: 'total',
id: 'result'
},columns),
remoteSort: true
});

Added a header toolbar with a button to add a new row from the server.

var gridHead = grid.getView().getHeaderPanel(true);
var tb = new Ext.Toolbar(gridHead, [{text: 'Add Row',handler : function(){
ds.load('Dispatcher?&method=getGridData&addRow=true');
}}]);

I get the server hit from the ds.load('url') but the old parms are used instead of 'Dispatcher?&method=getGridData&addRow=true'
i.e. the addRow parm is missing from the request. If I add 'addRow=false' to the original DS definition URL then I do get the parm on the addRow ds.load request but the value is still from the original URL i.e. false.

Using Ext 1.0 b2

tryanDLS
17 Apr 2007, 10:26 AM
First, upgrade to the 1.0 release.

Did you try building the queryparms into the params object instead of trying to put them into the url?

mcrusty
17 Apr 2007, 10:38 AM
OK updated to 1.0 release. Still no go with

ds.load('Dispatcher?method=getGridData&addRow=true');

OR
ds.load('Dispatcher', 'method=getGridData&addRow=true');


Or did you mean something else by "params object" ?

thanks,
Mike

mcrusty
17 Apr 2007, 10:47 AM
OK thanks,

ds.load({params:{addRow:'true'}});

did the trick