View Full Version : Add query string parameter into DataModel
kovtik
10-03-2006, 08: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.
kovtik
10-03-2006, 09:08 AM
Oh, I have already found a solution.It was in the second parameter of the methodvoid 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?
jack.slocum
10-03-2006, 09:28 AM
If you append the params to your url:
load('data.php?foo=1&bar=2');
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.
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.