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
no collapse with adjacency model & xml
23/02/2010
11:52
Avatar
LK
Member
Members
Forum Posts: 3
Member Since:
23/02/2010
sp_UserOfflineSmall Offline

I'm having a problem with collapsing in treeGrid by using the adjacency model.

I've tried severeal times to get it working but it seems i'm missing a point & the demo of jqgrid for the adjacency model isn't working as well.

The problem is - if i expand a column it works fine it loads the right data by xml & shows them.

But if i collapse the parent-column it does nothing. So the child-data is still shown and if i expand the parent

again it loads the data again and if have twice the children-elements.

I'm using jqGrid 3.6.4

js-code:

$(document).ready(
    function()
    {
        jQuery("#treegrid").jqGrid({
            treeGrid: true,
            treeGridModel: 'adjacency',
            treeModel: 'adjacency',
            url: xml_url,
            treedatatype: "xml",
            mtype: "POST",
            colNames:["id","name"],
            colModel:[
                {name:'id',index:'id', width:1,hidden:true,key:true},
                {name:'name',index:'name', width:180}
                 ],
            height:'auto',
            pager : jQuery("#ptreegrid"),
            ExpandColumn : 'name',
            caption: "Treegrid documents"
         });
    });

the xml of a child send by the server:

echo "<?xml version='1.0' encoding='utf-8' ? >";
    echo "<rows>";
    echo "<page>1</page>";
    echo "<total>1</total>";
    echo "<records>1</records>";
        echo "<row>";
        echo "<cell>" . $document->id ." </cell>";
        echo "<cell>" . $document->title ." </cell>";
        echo "<cell>" . $level . "</cell>";
        echo "<cell>" . $parent . "</cell>";
        echo "<cell>true</cell>";
        echo "<cell>false</cell>";
        echo "</row>";
    echo "</rows>";

===============================

Thanks in advance for any help.

23/02/2010
11:58
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Check to hee in your data if you construct it correct and there are no duplicate row id's.

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

23/02/2010
12:13
Avatar
LK
Member
Members
Forum Posts: 3
Member Since:
23/02/2010
sp_UserOfflineSmall Offline

Hi,

thank you for the fast answer.

I've checked the data again and there are no duplicate row id's. I created a test-case with only one parent with one

child and the html seems to be correct .

The created html looks like :

  <tr class="ui-widget-content jqgrow ui-row-ltr" role="row" id="36 ">

  <td title="36 " style="display: none;" role="gridcell">36 </td>

  <td title="test2 " style="" role="gridcell"><div style="width: 18px;" class="tree-wrap tree-wrap-ltr">

  <div class="ui-icon treeclick ui-icon-triangle-1-s tree-minus" style="left: 0px;"/></div>

  <span>test2 </span></td>

  <td title="0" style="display: none;" role="gridcell">0</td>

  <td title="3" style="display: none;" role="gridcell">3</td>

  <td title="false" style="display: none;" role="gridcell">false</td>

  <td title="false" style="display: none;" role="gridcell">false</td>

</tr>

<tr class="ui-widget-content jqgrow ui-row-ltr" role="row" id="38 ">

  <td title="38 " style="display: none; width: 1px;" role="gridcell">38 </td>

  <td title="test2_test1 " style="width: 175px;" role="gridcell">

  <div style="width: 36px;" class="tree-wrap tree-wrap-ltr">

  <div class="ui-icon ui-icon-triangle-1-e tree-plus treeclick" style="left: 18px;"/></div>

  <span>test2_test1 </span></td>

  <td title="1" style="display: none; width: 1px;" role="gridcell">1</td>

  <td title="36" style="display: none; width: 1px;" role="gridcell">36</td>

  <td title="false" style="display: none; width: 1px;" role="gridcell">false</td>

  <td title="false" style="display: none; width: 1px;" role="gridcell">false</td>

</tr>

25/02/2010
10:55
Avatar
LK
Member
Members
Forum Posts: 3
Member Since:
23/02/2010
sp_UserOfflineSmall Offline

Maybe my problem ist to specific.

Does anyone have a working demo of treegrid using the adjacency-model with xml ?

That would help me a lot.

thanks in advance

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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