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
addChildNode do not count on expanded parameter of the pow
22/10/2012
10:43
Avatar
rumax
Member
Members
Forum Posts: 5
Member Since:
31/07/2011
sp_UserOfflineSmall Offline

In case localdata, addChildNode do not count on expanded parameter of the pow and all rows are expanded.

grid.jqGrid ('addChildNode', row.id, row.parent, row);

22/10/2012
14:32
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

A grid (treegrid) configuration will help and how look your row?

Regards

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.

22/10/2012
15:45
Avatar
rumax
Member
Members
Forum Posts: 5
Member Since:
31/07/2011
sp_UserOfflineSmall Offline

The data I try to add:

var mydataSrc = [{id:"1", name:"Cash", num:"100", level:"0", parent:"", isLeaf:false, expanded:false, loaded:true }, {id:"2", name:"Cash 1", num:"1", level:"1", parent:"1", isLeaf:false, expanded:false, loaded:true },{id:"3", name:"Sub Cash 1",num:"1", level:"2", parent:"2", isLeaf:true, expanded:false, loaded:true },{id:"4", name:"Cash 2", num:"2", level:"1",parent:"1", isLeaf:true, expanded:false, loaded:true },{id:"5", name:"Bank\'s", num:"200", level:"0", parent:"",isLeaf:false, expanded:false, loaded:true },{id:"6", name:"Bank 1", num:"1", level:"1", parent:"5", isLeaf:true,expanded:false, loaded:true },{id:"7", name:"Bank 2", num:"2", level:"1", parent:"5", isLeaf:true, expanded:false,loaded:true },{id:"8", name:"Fixed asset", num:"300", level:"0", parent:"", isLeaf:true, expanded:false,loaded:true }];

grid:

var grid = $('<table/>').appendTo('body');    grid.jqGrid({        treedatatype: "local",        datatype: "local",        datastr: [],        colNames:["Id","Account","Acc Num"],        colModel:[            {name:'id', index:'id', width:1, hidden:true, key:true},            {name:'name', index:'name', width:180},            {name:'num', index:'acc_num', width:80, align:"center"}        ],        height: 'auto',        gridview: true,        rowNum: 10000,        sortname: 'id',        treeGrid: true,        treeGridModel: 'adjacency',        ExpandColumn: 'name',        caption: "Test"    });

Adding data:

var row;

for (var i = 0, l = mydataSrc.length; i < l; ++i) {

row = mydataSrc[i];

grid.jqGrid ('addChildNode', row.id, row.parent, row);

}

 

My solution:

In jquery.jqGrid.js did the following changes in addChildNode function

1) 

//parentdata[expanded] = true;

2) 

.find("div.tree-leaf").removeClass($t.p.treeIcons.leaf+" tree-leaf").addClass((parentdata[expanded] ? $t.p.treeIcons.minus+" tree-minus" : $t.p.treeIcons.plus+" tree-plus"));

3) 

//data[expanded] = false;

if (data[expanded] === undefined) {

data[expanded] = false;

}

 

23/10/2012
11:42
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Thanks. Just fixed the problem. It is in GitHub.

The fix is little bit diffrent.

Regards

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.

23/10/2012
12:22
Avatar
rumax
Member
Members
Forum Posts: 5
Member Since:
31/07/2011
sp_UserOfflineSmall Offline

Thanks!

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
53 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