View Full Version : Add query string parameter into DataModel
kovtik
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.
kovtik
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?
jack.slocum
3 Oct 2006, 5: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.
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.