Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
treegrid bug of cant collapse node, XML from server.
30/07/2010
07:44
Avatar
ivanchain
Member
Members
Forum Posts: 55
Member Since:
11/03/2010
sp_UserOfflineSmall Offline

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" ?>

- <rows>
  <page>1</page>
  <total>1</total>
  <records>1</records>
- <row>
  <cell>5</cell>
  <cell>tesstname1</cell>
  <cell />
  <cell>2</cell>
  <cell>2</cell>
  <cell>false</cell>
  <cell>false</cell>
  </row>
- <row>
  <cell>6</cell>
  <cell>tesstname2</cell>
  <cell />
  <cell>2</cell>
  <cell>2</cell>
  <cell>false</cell>
  <cell>false</cell>
  </row>
- <row>
  <cell>7</cell>
  <cell>tesstname3</cell>
  <cell />
  <cell>2</cell>
  <cell>2</cell>
  <cell>false</cell>
  <cell>false</cell>
  </row>
  </rows>
Please help,  the code above work well in jqgrid 3.6
yours,
Ivan
30/07/2010
07:58
Avatar
ivanchain
Member
Members
Forum Posts: 55
Member Since:
11/03/2010
sp_UserOfflineSmall Offline

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

03/08/2010
19:49
Avatar
niclarcipretti
Member
Members
Forum Posts: 4
Member Since:
02/08/2010
sp_UserOfflineSmall Offline

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″ ?>

- <rows>
  <page>1</page>
  <total>1</total>
  <records>1</records>
- <row>
  <cell>5</cell>
  <cell>tesstname1</cell>
  <cell />
  <cell>2</cell>
  <cell>2</cell>
  <cell>false</cell>
  <cell>false</cell>
  </row>
- <row>
  <cell>6</cell>
  <cell>tesstname2</cell>
  <cell />
  <cell>2</cell>
  <cell>2</cell>
  <cell>false</cell>
  <cell>false</cell>
  </row>
- <row>
  <cell>7</cell>
  <cell>tesstname3</cell>
  <cell />
  <cell>2</cell>
  <cell>2</cell>
  <cell>false</cell>
  <cell>false</cell>
  </row>
  </rows>

Hope you can figure out what's wrong in the XML data generation.

Regards

Nicolas

10/08/2010
17:59
Avatar
ivanchain
Member
Members
Forum Posts: 55
Member Since:
11/03/2010
sp_UserOfflineSmall Offline

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

13/08/2010
04:39
Avatar
gdboling
Member
Members
Forum Posts: 4
Member Since:
07/04/2008
sp_UserOfflineSmall Offline

I'm having the exact same issue with both JSON and XML data....

http://stackoverflow.com/quest.....her-issues

13/08/2010
19:57
Avatar
jmorquecho
México
New Member
Members
Forum Posts: 1
Member Since:
13/08/2010
sp_UserOfflineSmall Offline

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

Wink 

14/08/2010
05:28
Avatar
cocinerox
Budapest, Hungary
New Member
Members
Forum Posts: 2
Member Since:
14/08/2010
sp_UserOfflineSmall Offline

Thanks, jmorquecho! I had the same problem tonight, google brought me here, and your patch works for me. Laugh

Forum Timezone: Europe/Sofia

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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information