Forum
18:58
Just curious if anyone else has come across the treeGrid parents not collapsing ? I am having this problem with both xml and json. I see it works in the demo so there must be a trick I am missing.
* Using the latest version 3.5.3
* checked the docs to no avail
* Firefox 3.0.14
* Mac OSX 10.5.8
HTML
<html><head><link rel="stylesheet" type="text/css" media="screen" href="css/sunny/jquery-ui-1.7.2.custom.css">
<link rel="stylesheet" type="text/css" media="screen" href="ui.jqgrid.css">
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="grid.locale-en.js"></script>
<script type="text/javascript" src="jquery.jqGrid.min.js"></script>
<script type="text/javascript" src="xml.js"></script></head>
<body><table id="list2" class="scroll" cellpadding="0" cellspacing="0"></table>
<div id="pager2" class="scroll" style="text-align:center;"></div></body></html>
xml.js code:
$(document).ready(function(){
jQuery(”#list2″).jqGrid({
url: 'tree.xml',
treedatatype: “xml”,
mtype: “POST”,
colNames: ["THING","id"],
colModel: [{name: 'thing', index: 'thing', width: 220, hidden: false},
{name: 'id', index: 'id', width: 120, hidden:false, key:true}],
height: 300,
width: 300,
pager: jQuery(”#page2″),
imgpath: 'css/sunny/images',
treeGrid: true,
ExpandColumn: 'thing',
caption: 'My Things!',
})
});
Results from initial call to tree.xml:
<rows>
<total>1</total>
<page>1</page>
<records>1</records>
<row>
<cell>Jon Henry</cell>
<cell>0</cell>
<cell>0</cell>
<cell>0</cell>
<cell>0</cell>
</row>
<row>
<cell>Margret Woot</cell>
<cell>3</cell>
<cell>0</cell>
<cell>0</cell>
<cell>0</cell>
</row>
</rows>
Results from post call upon opening first parent:
<rows>
<total>1</total>
<page>1</page>
<records>1</records>
<row>
<cell>Alex Henry</cell>
<cell>1</cell>
<cell>1</cell>
<cell>0</cell>
<cell>1</cell>
</row>
<row>
<cell>Angela Henry</cell>
<cell>2</cell>
<cell>1</cell>
<cell>0</cell>
<cell>1</cell>
</row>
</rows>
No POSTS are being returned to the server upon clicking the collapse button.
=============
As a side note treedatatype: “json”, doesn't work.
Thanks in advance for any guidance.
23:10
Never mind about the collapsing
Little does one easily know:
* The first parents left_field must be = to it's id and 0 (unless set otherwise).
* The first parent right_field must be = this parent last child id + 1
* The first child left_field must be = the parent id + 1
* The first child right_field must be = its' left field + 1
* Each progressive childs left_field must = the previous childs right_field
* Each progressive childs right_field must = this childs left_field + 1
* Each progressive parents left_field must = the previous Parents last childs' left_field + 1
* Each progressive parents right_field must = its' left_field + 1
As an additional note the level_field is for “indentation”… 0 = baseline, 1 indent = 1 space, 2 = indent 2 spaces…
The plugin is great, but the documentation is horrific.
Tripp.
Most Users Ever Online: 715
Currently Online:
30 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