jQWidgets Forums

jQuery UI Widgets Forums TreeGrid display xml structure in treegrid

This topic contains 2 replies, has 2 voices, and was last updated by  Shindou 7 years, 11 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • display xml structure in treegrid #93570

    Shindou
    Participant

    Hello,

    I’m searching a way to display xml structure in treegrid,

    What I get the original XML data:

    <ctp-msg-tpl>
      <item code="msg" count="1..1">
        <item code="msgCode" count="1..1">
        </item>
        <item code="direction" count="1..1">
        </item>
        <item code="body" count="1..1">
          <item code="acctNo" count="1..1">
          </item>
        </item>
      </item>
      <item code="msg" count="1..1"/>
    </ctp-msg-tpl>

    What I want to show is like a xml editor(user can add/delete/upadte xml elements and attributes):
    code count
    msg 1..1
    >>msgCode 1..1
    >>direction 1..1
    >>body 1..1
    >>>>acctNo 1..1
    msg 1..1

    I don’t konw how to define the hierarchy,is there a way to achieve it?

    Thanks in advance!

    display xml structure in treegrid #93576

    Peter Stoev
    Keymaster
    display xml structure in treegrid #93588

    Shindou
    Participant

    Thanks for yout answer,but the example is not what I want.

    For example,I received the following XML data:

    <item code="msg">
      <item code="msgCode">
        <item code="encode"></item>
      </item>
    </item>

    Element:<item code=”msg”> is parent of element:<item code=”msgCode”>
    And element:<item code=”msgCode”> is parent of element:<item code=”encode”>

    I want to show this 3-deep-level relation(msg->msgCode->encode),

    because the parent-child relation is obvious(by start tag and end tag),
    so I think it’s not necessary to provide a hierarchy like:

    {
      root: 'Employees',
      record: 'Employee'
    }

    or

    {
        keyDataField: { name: 'EmployeeID' },
        parentDataField: { name: 'ReportsTo' }
    }

    But I still don’t know how to defines the root and record of each hiearchy level in jqxTreeGrid.

    Sorry for my poor English,I find a little similar question at this forum,
    hope it’s useful to make my question clear:
    http://www.jqwidgets.com/community/topic/my-first-treegrid-3-level-deep-xml/

    Thanks again!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.