Forum
12:23
10/05/2010
hiii....,
i'm a newbie..
i have an issue use tree grid..
my grid can't show..
i have a tree grid that have configuration like that:
jQuery("#west-grid").jqGrid({
url: "tree.xml",
datatype: "xml",
height: "auto",
pager: false,
loadui: "disable",
colNames: ["id","Menu","url"],
colModel: [
{name: "id",width:1,hidden:true, key:true},
{name: "menu", width:150, resizable: true, sortable:false},
{name: "url",width:1,hidden:true}
],
treeGrid: true,
treeGridModel : "adjacency",
caption: "Tree Grid Testing",
ExpandColumn: "menu",
//autowidth: true,
width: 196,
rowNum: 6,
ExpandColClick: true,
treeIcons: {leaf:'ui-icon-document-b'},
onSelectRow: function(rowid) {
var treedata = $("#west-grid").jqGrid('getRowData',rowid);
if(treedata.isLeaf=="true") {
//treedata.url
var st = "#t"+treedata.id;
if($(st).html() != null ) {
maintab.tabs('select',st);
} else {
maintab.tabs('add',st, treedata.menu);
$(st,"#tabs").load(treedata.url);
/*$.ajax({
url: treedata.url,
type: "POST",
dataType: "html",
complete : function (req, err) {
$(st,"#tabs").append(req.responseText);
}
});*/
}
}
},
loadError : function(xhr, status, error) {
console.log(xhr);
console.log(status);
console.log(error);
if (xhr.responseText.length > 0) {
$('#error').replaceWith('<b>'+xhr.responseText+'</b>');
}
}
});
and my xml data like that :
<?xml version='1.0' encoding="utf-8"?>
<rows>
<page>1</page>
<total>1</total>
<records>1</records>
<row><cell>1</cell><cell>Operational</cell><cell></cell><cell>0</cell><cell></cell><cell>false</cell><cell>false</cell></row>
<row><cell>2</cell><cell>Input</cell><cell></cell><cell>1</cell><cell>1</cell><cell>false</cell><cell>false</cell></row>
<row><cell>3</cell><cell>Reservation</cell><cell>localex.html</cell><cell>2</cell><cell>2</cell><cell>true</cell><cell>false</cell></row>
<row><cell>4</cell><cell>Invoice</cell><cell>localex.html</cell><cell>2</cell><cell>2</cell><cell>true</cell><cell>false</cell></row>
<row><cell>5</cell><cell>Reports</cell><cell></cell><cell>1</cell><cell>1</cell><cell>false</cell><cell>false</cell></row>
<row><cell>6</cell><cell>Master Data</cell><cell></cell><cell>1</cell<cell>1</cell><cell>false</cell><cell>false</cell></row>
</rows>
when i reduce my xml code that row cell id are 5 and 6, my tree grid is work fine..
when i'm not reduce the row that have cell id are 5 and 6, my grid not show..
is my xml code has wrong?
can some one explain me?
Best Regards,
zenixgrace
04:58
10/05/2010
InsaneWookie said:
Looks like your XML has a syntax error on the last row
Your missing a closing ">"
Rowan
thanks Insane for ur help...
sorry..
is my bad
i have one question again..
when the parent node don't have a child
when i click the parent node it's expand a same row...
seem like the node retrigger my xml code again..
in that example : node that have id 5
when i click the node id 5, it expand a same node (duplicate node from root to end )
when i click the duplicate node that node id is 5, my node has expand again..
is there a bug or not?
best regards,
zenixgrace
Most Users Ever Online: 715
Currently Online:
48 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