Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by josh on Jul 19, 2008 22:14
open dhtmlx forum
grid - dynamic loading and grid properties from xml

hello,

i currently have grid with smartrendering and dynamic loading and dynamic update(using dataprocessor). the grid retrieves data dynamically from the server from a JSP page that feeds XML data.

what i am interested in now is, in the XML response that is sent back to the GRID on every request to the server, can i add GRID configurations?

---------------------------------------------------------------------------------------------------------------------------
Example:
right now xml from server is of this format:
<rows total_count="x" pos="y">
<row id="xx">
<cell>
...
</cell>
</row>
</rows>

but now what i want is:

<head>
<beforeInit>
<call command="methodName"><param>string value</param></call>
</beforeInit>
<afterInit>
<call command="methodName"><param>string value</param></call>
</afterInit>

<column width="50" type="ed" align="right" color="white" sort="str">Sales</column>
<column width="150" type="combo" editable="false" source="data.xml" …>TEXT</column>
<column type="combo" source="complete.php" auto="true" cache="true" sub="true"… >TEXT</column>
</head>

<rows total_count="x" pos="y">
<row id="xx">
<cell>
...
</cell>
</row>
</rows>
---------------------------------------------------------------------------------------------------------------------------

...if i send this, will the grid still work? since with dynamic loading, the first 20 requested rows had a specific config, then the next 50rows somehow gets different column configurations....will the grid be able to handle that?

what i am trying to achieve here is:
1) integrating combo(read from another jsp xml feed) with grid by setting the column directly instead on setting it on every cell
2) set the header dynamically for multilingual purposes


is that possible? or would you have any suggestions for me to implement this?



thanks in advance



cheers,


Answer posted by Support on Jul 21, 2008 02:18
>>...if i send this, will the grid still work?
Technically it possible, but each time when grid receives configuration section in XML it retinits structure, which will result in lost of current data|state.

>>then the next 50rows somehow gets different column configurations
Only one column configuration allowed per grid, component can't have different configuration for different rows.

>>1) integrating combo(read from another jsp xml feed) with grid by setting the column directly instead
Possible.
    http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Combo_excell.html#grid_art_comboexcell
>>2) set the header dynamically for multilingual purposes
    The header can be set directly from XML, which means it can be generated dynamically.
Answer posted by josh on Jul 21, 2008 09:45
hello,

can we do partial grid initialization from both javascript and XML?

say i initialize all the column types, and sort using JS before the init() called.
then in my (dynamic) xml file, i initialize the headers, columns etc...

would that work?
Answer posted by Support on Jul 22, 2008 02:58
It is not possible. Grid must have all configuration defined in js script or all in XML