Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Vikram on Dec 14, 2008 19:44
open dhtmlx forum
Load 2 Separate DataGrid's from the Same XML

Are there any built in procedures available to load 2 separate dataGrid's from a single XML segregating them based on a field or condition on the XML String??

Answer posted by Support on Dec 15, 2008 02:19
There is no native solution , but next can be done

a) each grid can have different set of xml settings
    http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Loading_data_in_grid.html#grid_art_loadingdata
b) xml can be formed in such way, that it will contain one kind of row tags for grid A and different kind of rows for grid B

gridA.xml={
  top: "rows",
  row: "./rowA",
  cell: "./cell",
  s_row: "row",
  s_cell: "cell",
  row_attrs: [],
  cell_attrs: []
 }

gridA.xml={
  top: "rows",
  row: "./rowB",
  cell: "./cell",
  s_row: "row",
  s_cell: "cell",
  row_attrs: [],
  cell_attrs: []
 }

In XML

<rows>
    <rowA> ... data for first grid </rowA>
    <rowB> ... data for second grid </rowB>