Forum
14:32
Moderators
30/10/2007
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.
15:45
31/07/2011
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;
}
11:42
Moderators
30/10/2007
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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66