Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Giuseppe on Oct 29, 2007 04:48
open dhtmlx forum
updating xml file and synchronize it with a database

Hi,
I don't know if it's the best solution, in fact I would thank you all for any suggestion you have.
I would know how can I update xml file (‘cause when I refresh the form, xml old values are reloaded into page), or what is the best method to do this.
And what is the way to load the xml file into a database? Thank you.
Answer posted on Oct 29, 2007 08:30
There is no way to directly manipulate with source XML file , the
component is pure client side, so it not able to manipulate with server
data on its own, but next way to save data back to server is available

( all samples mentioned below can be checked online at dhtmlx.com )

a) By using dataProcessor library, this way for each action in tree (
adding/deleting/editing) related event handler generate AJAX call to
server side. There are no ready to use sample for Java but guide
describes which vars sent to server for each type of call. You only need
to implement the correct DB updates for specified AJAX calls.
    samples/savedata_grid.html

b) By serialization. The dhtmlxGrid can be serialized back to XML and
sent to server ( the sending routine is not implemented in grid and must
be implemented manually ), where XML can be parsed, data extracted and
DB updated.
    samples/pro_serialize.html

c) form integration - grid can integrates in surrounding <form> tag and
include all ( changed ) values in form scope on submit. This functionality
available starting from dhtmlxGrid 1.3
    samples/pro_form.html

d) handle onCellChanged or onCellEdit events and make custom sync on
cell value changing


a-c available only in PRO version,