Forum
22:57
05/05/2011
If clicked in root node, treegrid properly shows leafs. Clicking again in root node does not close left nodes. How to fix this so that child nodes are closed on click ?
$(function () {
$("#west-grid").jqGrid({
url: '/Store/Store/GridData',
datatype: "json",
mtype: "POST",
height: "auto",
pager: false,
loadui: "disable",
treeGridModel: "adjacency",
colNames: ["id", "", "url"],
colModel: [
{ name: "id", width: 1, hidden: true, key: true },
{ name: "menu" },
{name: "url", width: 1, hidden: true }
],
autowidth: true,
treeGrid: true,
ExpandColumn: "menu",
rowNum: 200,
ExpandColClick: true,
treeIcons: { leaf: 'ui-icon-document-b' },
onSelectRow: function (rowid) {
var treedata = $("#west-grid").jqGrid('getRowData', rowid);
if (treedata.isLeaf == "true") {
window.location = '/Store/' + treedata.url;
}
}
}
);
});
22:32
10/05/2011
Just had a similar issue, maybe it will help you.
Make sure your IDs do not contain spaces, otherwise jqGrid will not be able to build the query string to find the child node to close it.
For example, my child node had the ID of '#Child Node'. When jqGrid built the query string to locate this node it stopped at whitespace which caused it to only look '#Child'. Since this node does not exist the resulting matched set was empty causing no nodes to be closed. Correcting my IDs to not contain whitespace remedied the problem.
See the collapseRow function in the jqGrid source for more info.
15:21
05/05/2011
Root level data returned to treeGrid is:
{"total":1,"page":1,"records":7,"rows":[{"id":"1","cell":["97","Varustus","Store/Browse/97","0",null,"false","true"]},{"id":"2","cell":["88","Matkavarustus","Store/Browse/88","0",null,"false","true"]},{"id":"3","cell":["146","Tarvikud","Store/Browse/146","0",null,"false","true"]},{"id":"4","cell":["84","Rehvid","Store/Browse/84","0",null,"false","true"]},{"id":"5","cell":["78","Lisatarvikud","Store/Browse/78","0",null,"false","true"]},{"id":"6","cell":["95","Õlid/Vedelikud","Store/Browse/95","0",null,"false","true"]},{"id":"7","cell":["150","Muu","Store/Browse/150","0",null,"false","true"]}]}
If clicked in first root node, data returned is:
{"total":1,"page":1,"records":5,"rows":[{"id":"1","cell":["85","Riided","Store/Browse/85","1","1","false","true"]},{"id":"2","cell":["72","Jalanõud","Store/Browse/72","1","1","false","true"]},{"id":"3","cell":["76","Kindad","Store/Browse/76","1","1","false","true"]},{"id":"4","cell":["73","Kaitsmed","Store/Browse/73","1","1","false","true"]},{"id":"5","cell":["83","Prillid","Store/Browse/83","1","1","false","true"]}]}
If clicked in root node again, this child does not collapse. As you see it looks like ids are number always. If worked with other data, child colllapses. So yes, it looks like it is data issue. What is wrong with this data ? How to fix ?
06:37
27/05/2011
Not sure if this is generated by your script or it happens when you paste them. But look after the id number the closing quote is not " but ″ instead.
{"id":"1","cell":["97","Varustus","Store/Browse/97","0",null,"false","true"]},
{"id":"2″,"cell":["88","Matkavarustus","Store/Browse/88","0",null,"false","true"]},
{"id":"3″,"cell":["146","Tarvikud","Store/Browse/146","0",null,"false","true"]},
{"id":"4″,"cell":["84","Rehvid","Store/Browse/84","0",null,"false","true"]},
{"id":"5″,"cell":["78","Lisatarvikud","Store/Browse/78","0",null,"false","true"]},
{"id":"6″,"cell":["95","Õlid/Vedelikud","Store/Browse/95","0",null,"false","true"]},
{"id":"7″,"cell":["150","Muu","Store/Browse/150","0",null,"false","true"]}
]}
Compare "id":"1" and "id":"2″
Most Users Ever Online: 715
Currently Online:
54 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