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
Tree Grid and Json
05/11/2008
14:54
Avatar
axilucian
Member
Members
Forum Posts: 9
Member Since:
18/10/2008
sp_UserOfflineSmall Offline

Hi,

Is there any example of loading a treeGrid with json data?

Thanks!

Great job, Tony!

06/11/2008
02:08
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

There is no example, but if you follow the rules, you can easy configure

this adding in the json data the needed fields

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

06/11/2008
10:05
Avatar
axilucian
Member
Members
Forum Posts: 9
Member Since:
18/10/2008
sp_UserOfflineSmall Offline

I'm getting a error Type: parsererror; Response: 200 OK using:

$responce->page = 1;
$responce->total = 1;
$responce->records = 1;
foreach($rows as $row) { 

      if($row[rgt] == $row[lft]+1) $leaf = 'true';else $leaf='false';
      $responce->rows[$i]['cell']=array($row['id'],$row['name'],$row['date'],false,$leaf,$row[lft],$row[level],$row[rgt]);

}

echo json_encode($responce); 

where the grid columns are id(hidden),name,date

tried also with:

$responce->rows[$i]['cell']=array($row['id'],$row['name'],$row['date'],$row[level],$row[lft],$row[rgt],$leaf,false);

after the xml format from your example.

Usign XML works fine, w/ json I miss something, but i can't figure out... 😐

Thanks! I apreciate your help!

25/11/2008
09:42
Avatar
KG
Member
Members
Forum Posts: 6
Member Since:
18/11/2008
sp_UserOfflineSmall Offline

Hi!

$responce->rows[$i]['cell']=array($row['id'],$row['name'],$row['date'],false,$leaf,$row[lft],$row[level],$row[rgt]);

}

false here should be a string (put quotation marks) and it worked well for me.

K

25/11/2008
13:27
Avatar
axilucian
Member
Members
Forum Posts: 9
Member Since:
18/10/2008
sp_UserOfflineSmall Offline

Thx KG!

This is still not working for me:

to define the grid columns i used:

colNames: ["id","Name","Date"],
colModel: [
          {name:'d',index:'id', width:1,hidden:true,key:true},
          {name:'name',index:'name', width:180},
          {name:'date',index:'date', width:50, align:"center"}
]

Do I need to add other hidden columns ?

Thank you!

26/11/2008
02:01
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Use FireBug to see the response

Regards

Tony

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

16/03/2009
14:22
Avatar
afroz429
Member
Members
Forum Posts: 8
Member Since:
16/03/2009
sp_UserOfflineSmall Offline

Hi Tony,

I got the adjacency working with json but there's a small problem. when I expand a node and collapse it, the child nodes dont hide. and clicking expand again duplicates the child nodes. am I missing something here?

Thanks

Afroz

17/03/2009
00:29
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

Hello,

Update to the latest stable release.

Regards

For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.

24/09/2009
12:08
Avatar
fuhrysteve
Member
Members
Forum Posts: 12
Member Since:
24/09/2009
sp_UserOfflineSmall Offline

I'm also having difficulty getting the rows to collapse in 3.5.3… Also, most of the rows are opening with blank data,

[Update: turns out I had my levels wrong on that one..
made the row wider, and there were mas my row :)
]

but I am sending my JSON right.. Any clue why this might be?

Oops.. wrong amount of fields.


24/09/2009
13:31
Avatar
tim
Guest
Guests

I have a working example here:

http://www.blackstag.com/json-example

it's not adjacency, but it shouldn't matter - since your issues are json related.

just use firebug and look at the console return json data.

tim

24/09/2009
15:40
Avatar
Ryan
Guest
Guests

Hey there IE7 is so crap. Tim's example does not work there either.

24/09/2009
16:51
Avatar
tim
Guest
Guests

ugh. I use mac and only venture to IE if I have to.

I find many IE issues become resolved using the proper doc string. Might be worth checking out, but truthfully I have no real good advice for you with IE Yell

tim

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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