dhtmlxconnector:xml_format_used_by_connector [DHX documentation]

PHP Connector DHTMLX

XML format used by connector

Grid

   <rows>
           <row id="some1"><cell>value 1,1</cell><cell>value 1,2</cell></row>
           <row id="some2"><cell>value 2,1</cell><cell>value 2,2</cell></row>
   </rows>
  • row - the tag represents row in the grid
  • cell - the tag represents cell in the grid

row@id - the mandatory attribute, must be unique for each row; row and cell tags may contain additional attributes which will be processed in default way.

In dynamic loading mode

   <rows total_count="50000" pos="1230">
           <row id="some1230"><cell>value 1,1</cell><cell>value 1,2</cell></row>
           <row id="some1231"><cell>value 2,1</cell><cell>value 2,2</cell></row>
   </rows>
  • rows@total_count - count of rows in grid, needs to be sent only for the first data request ( when posStart parameter is not defined )
  • rows@pos - equal to posStart parameters, defines where grid data will be added

TreeGrid

   <rows>
           <row id="some1">
              <cell image="some.gif">value 1,1</cell><cell>value 1,2</cell>
              <row id="some11"><cell>child value 1</cell><cell>child value 2</cell></row>
           </row>
           <row id="some2"><cell>value 2,1</cell><cell>value 2,2</cell></row>
   </rows>
  • row - the tag represents row in the grid, one row tag can contain other row tags inside ( parent - child relation in the hierarchy )
  • cell - the tag represents cell in the grid
  • row@id - the mandatory attribute, must be unique for each row
  • cell@image - can define image for tree cell in grid ( optional )

Dyn. loading

   <rows parent="id">
           <row id="some1" xmlkids="1">
              <cell image="some.gif">value 1,1</cell><cell>value 1,2</cell>
           </row>
           <row id="some2"><cell>value 2,1</cell><cell>value 2,2</cell></row>
   </rows>
  • row@xmlkids - defines that row can contain child nodes
  • rows@parent - the name of parent ID ( equal to incoming “id” parameter ) , ID of virtual root - 0

Tree

   <tree>
        <item id="some" text="name">
                 <item id="child1" text="name 1"/>
                 <item id="child2" text="name 2"/>
        </item>
   </tree>
  • item tag - item in a tree, can nest other item tags to represent parent-child relation
  • item@id - ID, unique for each item
  • item@text - label

In case of dyn. loading

   <tree id="id">
        <item id="some" text="name" childs="1">
        </item>
   </tree>
  • item@childs - defines that row can contain child nodes
  • tree@id - the name of parent ID ( equal to incoming “id” parameter ) , ID of virtual root - 0

Combo

    <data>
        <option value="some">Some label</option>
        <option value="other">Other label</option>
    </data>
  • option - represents option in combo

In case of dyn. loading:

    <data add="true">
        <option value="some">Some label</option>
        <option value="other">Other label</option>
    </data>

If “pos” parameter was provided, response must contain data@add attribute , to mark that it is not a new set of values, but addition to existing one.