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_TopicIcon
Autoloading Treegrid issue . . .
02/05/2011
19:50
Avatar
cra
Member
Members
Forum Posts: 3
Member Since:
15/02/2010
sp_UserOfflineSmall Offline

Hello all,

I am having a problem with an autoloading tree grid.

At present I have a structure that is only 2 levels deep.

1

a

b

c

2

a

When I click to expand a node, the grid seems to add another instance of the root node again as well as whichever sub node(s) should have been shown based on the the root node selected.

1

1

a

b

c

Here is a look at the XML before selecting the root node:

<?xml version="1.0" encoding="UTF-8"?>

<rows>

<page>1</page>

<total>1</total>

<records>1</records>

<row>

<cell>1112</cell>

<cell>Parent 1</cell>

<cell>0</cell>

<cell>NULL</cell>

<cell>false</cell>

<cell>false</cell>

</row>

</rows>

And here is a look at the XML after selecting the root node:

<?xml version="1.0" encoding="UTF-8"?>

<rows>

<page>1</page>

<total>1</total>

<records>1</records>

<row>

<cell>1112</cell>

<cell>Parent 1</cell>

<cell>0</cell>

<cell>NULL</cell>

<cell>false</cell>

<cell>false</cell>

</row>

  <row>

<cell>5207</cell>

<cell>Child 1</cell>

<cell>1</cell>

<cell>1112</cell>

<cell>false</cell>

<cell>false</cell>

</row>

</rows>

Also, here is my config:

$(document).ready(function(){

$("#gReport").jqGrid({

treeGrid: true,

treeGridModel: 'adjacency',

ExpandColumn: 'company',

url: document.forms['frmReport'].elements['gaddr'].value,

datatype: 'xml',

mtype: 'GET',

colNames: ["ID", "Company"],

colModel: [

{name: 'id', index: 'id', width: 1, hidden: true, key: true},

{name: 'company', index: 'company', width: 40, hidden: false, sortable: true}

],

rowNum: -1,

width: 980,

height: 'auto',

pager: false,

caption: ''

}),

});

Any help would be greatly appreciated.
Thanks.
-chris
29/07/2011
13:58
Avatar
waygood2000
UK
New Member
Members
Forum Posts: 1
Member Since:
29/07/2011
sp_UserOfflineSmall Offline

Hi,

It is because you including the parent node again in the second xml?

You should only get the children nodes for the parent requesting (nodeid)

Cheers

Matt

29/07/2011
14:05
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

You are right Matt, but the question was already answerd here.

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
21 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