Hello guys. I am new to the forum, so I beg your pardon if I am asking a silly question or if I trespass any local rules.
I am using JqGrid in TreeGrid mode for site navigation purposes. The usage is pretty simple and the tree is loaded only once upon site load so using adjacency mode sounded like a good option. Anyway, the problem I am facing is that it works up to a certain point. I've reached a stage where I simply can't add more nodes to it because it will break. The symptom is that the last node may hide its descendants as well as siblings and when clicked, the entire tree is requested again and appended to it. Not sure why this happens and why exactly at this point since the rest of the tree is working just fine.
Here's the code:
jQuery(“#west-grid”).jqGrid({
url: “${h.url_for(controller='desktop', action='menuTree')}”,
datatype: “xml”,
height: “auto”,
pager: false,
loadui: “disable”,
colNames: [“id”,'${_(“Menu Options”)}',”url”],
colModel: [
{name: “id”,width:1,hidden:true, key:true},
{name: “menu”, width:150, resizable: false, sortable:false, align: 'left'},
{name: “url”,width:1,hidden:true}
],
treeGrid: true,
treeGridModel: “adjacency”,
ExpandColumn: “menu”,
autowidth: true,
ExpandColClick: true,
treeIcons: {leaf:'ui-icon-document-b'},
onSelectRow: function(rowid) {
var treedata = $(“#west-grid”).jqGrid('getRowData',rowid);
if(treedata.isLeaf==”true”) {
$(“#contentPane”).load(treedata.url);
}
},
loadError: function(xhr, status, error) {
alert('${_(“An error occured while loading your menu list. Please report this bug.”)}');
}
});
It works when I supply the following XML:
It doesn't work when I supply the following XML. Notice that there's only one additional node that is a “Reports” children and that has a child of it's own.
Pointers are greatly appreciated. I might be overlooking something. It is quite common in me
.
Best regards to all.
Copyright 2014 TriRand LtdAll Rights ReservedRSS
Back to Top