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
jqgrid 4 Adjacency Model expanded_field problem
23/04/2011
11:56
Avatar
eai
Member
Members
Forum Posts: 9
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

Hello

I am testing jqgrid 4

I try to use tree mode with Adjacency Model.

Grid loads tree successfull, but ignore expanded_field.

My code does work with jqgrid version 3.6 jQuery 1.3.2

I use jquery  1.5.1 with jqgrid 4

Looks like it is a bug.

Evgeny

26/04/2011
20:14
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

I had close problem. To solve it I have to set loaded:true property for all nodes having expanded:true.

Look at the demo.

Best regards
Oleg 

28/04/2011
08:45
Avatar
eai
Member
Members
Forum Posts: 9
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

Demo does work well

Looks like I have to use JSON instead XML

Thanks a lot

03/05/2011
12:27
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Hi!

I personally prefer to use JSON instead of XML if it is possible, but you can do the same also with XML data. Look at the answer on the stackoverflow.com which I recently wrote. Probably it explain the problems which you has.

Best regards
Oleg 

03/05/2011
12:38
Avatar
eai
Member
Members
Forum Posts: 9
Member Since:
09/11/2009
sp_UserOfflineSmall Offline

Thank you Oleg,

I like JSON too.

Really I use XML for Tree only because it does not work with JSON.

Maybe be I do not use tree and JSON right way, but I do not have any correct example with tree and JSON yet

Best Regards

Evgeny 

P.S.

You correction with "loaded=true" does work good with XML too.

03/05/2011
19:01
Avatar
greyblue
New Member
Members
Forum Posts: 2
Member Since:
08/12/2010
sp_UserOfflineSmall Offline

Thank you very much, i had the same problem.

Any idea why this value "loaded" is now needed?

03/05/2011
20:10
Avatar
OlegK
Germany
Member
Members
Forum Posts: 1255
Member Since:
10/08/2009
sp_UserOfflineSmall Offline

Because of the line 67 of the file grid.treegrid.js:

ldat[expanded]=((ldat[expanded]=="true"||ldat[expanded]===true)?true:false) && ldat[loaded];
if(ldat[expanded] === true) {
    twrap += $t.p.treeIcons.minus+" tree-minus treeclick'";
} else {
    twrap += $t.p.treeIcons.plus+" tree-plus treeclick'";

If the row of data (ldat) not contain the loaded property, the construct ldat[loaded] will be equal to undefined. The expression true && undefined is equal to undefined. On the other side false && undefined is equal to false. So strange is JavaScript!

Thus in case of undefined loaded prioperty the value of ldat[expanded] will be set either to undefined or to false and never to true. So the node will not expanded in case of undefined loaded prioperty.

The code fragent which I described above is new in tree grid 4.0. So same code which run under jqGrid 3.8.2 and expanded some nodes could not expand the same node in jqGrid 4.0.

If one would change the code of jqGrid so that one would test

if(ldat[expanded] === false) {
    twrap += $t.p.treeIcons.plus+" tree-plus treeclick'";
} else {
    twrap += $t.p.treeIcons.minus+" tree-minus treeclick'";

instead of

if(ldat[expanded] === true) {
   ... 

the problem will also fixed.

Best regards
Oleg 

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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