Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Raymond on Sep 30, 2008 14:14
open dhtmlx forum
Dataprocessor in Grid

Please refer to the attached files and images at http://hsyst.com.au/gallery/main.php?g2_view=core.ShowItem&g2_itemId=629&g2_navId=x75ba734a

I recall reading comments in one of your update.php that tree details are passed automatically (without the need to specify tree parameters).

Fig 01: dataproc_grid_save_00.jpg
This image shows part of the XML tree where I am calling a page (properties_dp.php) that will display a grid in the iframe ('sampleframe'). This does not work. It requires that I explicitly specify the parameters - in this case properties_dp.php?tree_id=2

Writing changes from the grid back to the database is handled in update_tprop.php (a 'hacked' piece of your dataprocessor/update.php code). However, whilst I was able to test the database update calling this php file (with appropriate parameters) I was not able to save updates when called as XML - see images dataproc_grid_save_01.jpg and dataproc_grid_save_02.jpg.

Your help appreciated.
Answer posted by Support on Oct 01, 2008 05:51
>>This does not work. It requires that I explicitly specify the parameters - in this case properties_dp.php?tree_id=2
I'm not sure about exact code used in your case, but something similar to next must work. 
mytree.attachEvent("onClick",function(){
    window.frames["sampleframe"].document.location.href= mytree.getUserData(id,"thisurl")
    return true;
});

>> However, whilst I was able to test the database update calling this php file (with appropriate parameters)
It seems that you are using , the enableDataNames mode of dataprocessor, but the grid has not column IDs correctly specified
Please be sure that you have
 - setColumnIds command, if grid initialized from JS
 - id attribute of column tags if grid initialized from XML
Answer posted by Raymond on Oct 01, 2008 11:14
Unfortunately, I wasn't able to attach the code when submitting the initial question.
Attachments (1)
Answer posted by Support on Oct 02, 2008 02:24
In your code, you are using enableDataNames mode, which allows to send data back to server with more meaningthul names, but such names need to be defined on client side. 
To resolve problem , add next line to the client side code. 

  mygrid.setHeader("Property,Description");
  mygrid.setColumnIds("none,valu"); //valu - the name of parameter , which used in your server side code
Answer posted by Raymond on Oct 05, 2008 14:23
Thanks for that. Added the specified line. However, there was little change in the end result. Pls refer to images dataproc_grid_save_03/04.
Is there any other (more detailed) documentation for these components?

Answer posted by Support on Oct 06, 2008 06:11
The xml response is correct , which means data was correctly updated in DB, but somehow browser can't parse it. Most probably caused by missed header. 
Try to add next line

header("Content-type:text/xml"); //need to be added
echo("<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>\n");