View Full Version : Add query string parameter into DataModel

3 Oct 2006, 4:51 AM
How can I add query string parameter to a DataModel. This code does not work :( :
dataModel.baseParams["param"] = "asdf";I think it works only with remote paging or sorting, but I'm not using this features.

3 Oct 2006, 5:08 AM
Oh, I have already found a solution.It was in the second parameter of the method
void load(<Object> url, <String> params, <Function> callback, <Number> insertIndex)
of the YAHOO.ext.grid.LoadableDataModel class. However, how can I change the type (GET|POST) of the query?

3 Oct 2006, 5:28 AM
If you append the params to your url:


then GET is used.

If you supply the params as the second arg:

load('data.php', 'foo=1&bar=2');
// or
load('data.php', {foo: 1, bar: 2});

then POST is used.