Forum
12:46
24/09/2009
Is there any way to switch between tree data and not-tree data dynamically? I've tried variations of this with no success:
if ($(”table#mytree”).getUserData().isTree == true) {
$(”table#mytree”).setGridParam({treeGrid:true}).trigger(”reloadGrid”);
} else {
$(”table#mytree”).setGridParam({
treeGrid:false,
rowNum:200,
pager: '#mypager'
}).trigger(”reloadGrid”);
}
03:09
Moderators
30/10/2007
Hello,
You can use other event - loadBeforeSend, but it seems that this will not do the job, since you want your conditions depend on userData.
My suggestion is to use a custom datatype function, where you can analyze your data and set the appropriate pareameters.
Regards
Tony
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
09:48
24/09/2009
I ended up essentially making two pages: /mypage.php and /mypage.php?notree
then doing:
…
treeGrid: <?=json_encode(!isset($_REQUEST['notree']))?>,
…
});
Before I populate the graph, I send a request to the server to determine if the results will need a tree or not. Then, if the response indicates that the page needs a tree table but does is currently mypage.php?notree, I do:
or if the opposite is the case, I do:
Seems to work pretty well.
Most Users Ever Online: 715
Currently Online:
23 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66