Forum
07:44
11/03/2010
Hi, I just do an update from jgrid 3.6 to current 3.7, and found the treegrid could not work.
when I expand and read data from server , everything is OK, but when I click the node again(try to collapse it), the image icon showed the collapsed icon, but the data row is still there, and when I click the node again, it load the repeated record out again.
This is my code:
var dt = new Date();
jQuery("#list1").jqGrid({
treeGrid: true,
treeGridModel : 'adjacency',
ExpandColumn : 'MainDemoName',
ExpandColClick : true,
url: "/KPIGetData/DimData.aspx?SearchInput=dimtrucfortreegrid&DimName=ProductProcess" + "&rand="+ dt ,
datatype: "xml",
mtype: "GET",
colNames:["OLAPKey","MainDemoName","Script"],
colModel:[
{name:'OLAPKey',index:'OLAPKey', width:1,hidden:true,key:true},
{name:'MainDemoName',index:'MainDemoName', width:280},
{name:'Script',index:'Script', width:1,hidden:true}
],
height:'auto',
pager : "#pager1"
});
The XML data return from server is:
<?xml version="1.0" encoding="utf-8" ?>
07:58
11/03/2010
And another problem:
var grid = jQuery("#list1");
var olapkey = grid.getGridParam("selrow");
var record =grid.getRowData(olapkey);
alert(olapkey);
alert(grid.getNodeDepth(record));
in the above code, list1 is the same grid in my post above, olapkey could show correctly, point to the current selected row. But the grid.getNodeDepth(record) always return 0.
Above code work well with jqgrid 3.6, but has problem in jqgrid 3.7
19:49
02/08/2010
Hi Ivan,
There's a problem with the XML data you are returnin to the grid, whenever you see this kind of behavior in your tree grid, double check the JSON or XML data that you are returning cause its probably wrong.
Seeing your code, I could notice the following errors in your XML data (in red):
<?xml version="1.0″ encoding="utf-8″ ?>
Hope you can figure out what's wrong in the XML data generation.
Regards
Nicolas
17:59
11/03/2010
Nicolas, thank you for your reply.
But I think the "<cell />" is the abbreviations of "<cell></cell>".
In fact, in my server code, I don't use anything like "<cell/>", but like: "<cell>" +n_lvl.ToString() + "</cell>";
Just join the XML into a string, and then use:
Response.Clear();
Response.ContentType = "text/xml";
Response.Write(xmlString);
Response.End();
to return the XML to the grid side. The Response.Write() automatically change the "<cell></cell>" to the "<cell />".
Do you mean jqgrid will not see the <cell /> as a normal XML? That cause my problem? But the same xml works fine in jqgrid 3.6
yours
Ivan
04:39
07/04/2008
I'm having the exact same issue with both JSON and XML data....
19:57
13/08/2010
Hello Guys
I had the same problem and I found a solution that work for me, I think this is a bug in the grid.treegrid.js these are the details:
1. I'm using the jquery 1.4.2 and jqGrid 3.7.2, (I checked the last download available today and have the same problem in the grid.treegrid.js file)
2. I declare my treegrid like in the demos, i'm using "adjacency" model and json data type.
3. My problem was that the nodes expands with no problems, but when I try to collapse the node just do nothing.
After a long and detailed debugging, I found that in line 238 col 54 of the grid.treegrid file : if(this[parent_id] == rc.id) always compare each node id with the colapsing node id, but at this point rc.id has undefined value. If you chek the rc objetc it doesn't have the atrtibute id. I supouse that the attributes comes from $t.p.localReader.id, which has the value _id_. So, I change the code for something like this:
if(this[parent_id] == rc[$t.p.localReader.id]).
And the magic of the treeGrid comes back to alive.
Hope this help to the developers to fix the problem and deploy soon the correction.
cheers
Most Users Ever Online: 715
Currently Online:
47 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