Hi Abu,
I am trying to pass the values obtained from the URL to the add/edit mode of the grid.
In detail:Say this is my URL(WWW.xzy.com/hello.php?id=1&name=Dell).
i want to pass this id and name into some column,when i open in add/edit mode of the new page with the above URL.
How to pass it, i am trying to copy it to local variable,is it possible to set grid column values to local variable?
Hello,
You can simply set this value in column using following config.
$col["name"] = "pc_name";
…
$col["editoptions"] = array("defaultValue" => $_GET["name"]);
defaultValue only comes when adding. If you want same value at edit, you need to set "value" instead of "defaultValue"
Hi,
is it possible to do the same with a query?
For instance
http://WWW.xzy.com/hello.php?id=1&name=myqueryterm
The result should be as if I sarch in column "name" the term "queryterm"
Is it possible to pre-filter a grid by an url-parameter? Or do I have to set up for each case an own file with own select?
Best regards,
Mario
This feature is available in latest build.
Demo: http://www.phpgrid.org/demo/demos/search/search-onload-url.php?list1_total=%3E100&list1_name=ana
Code: http://www.phpgrid.org/demo/demos/search/search-onload-url.phps
Usage: Add querystring param, gridid_colname=value e.g. list1_name=ana
Kindly email me your order number for updated build.
I thank you. It works great! It works according this pattern
http://www.domain.com/filename.php?list1_colfieldname=searchedteam
One has to combine
p.e. list1 = which is the name in the grid-output, mostly last line, like …
————-
$out = $g->render("list1");
—————-
… with the colfieldname
p.e. "colfieldname" = which is the name of the column.