Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_TopicIcon
Toggle Treeview / Pager
27/10/2009
12:46
Avatar
fuhrysteve
Member
Members
Forum Posts: 12
Member Since:
24/09/2009
sp_UserOfflineSmall Offline

Is there any way to switch between tree data and not-tree data dynamically? I've tried variations of this with no success:

loadComplete: function () {
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”);
}

29/10/2009
03:09
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

29/10/2009
09:48
Avatar
fuhrysteve
Member
Members
Forum Posts: 12
Member Since:
24/09/2009
sp_UserOfflineSmall Offline

I ended up essentially making two pages: /mypage.php and /mypage.php?notree

then doing:

$(”#mytree”).jqGrid({

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:

window.location = 'mypage.php?tree_data_to_load=foobar';

or if the opposite is the case, I do:

window.location = 'mypage.php?notree?data_to_load=foobar';

Seems to work pretty well.

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information