Hi there,
I’m now trying to update data using gantt and DataProcessor.
I’ve followed the page dhtmlx.com/docs/products/dhtmlx … _once.html
and my codes are the almost the same as they are:
<script>
var myGrid, myDataProcessor;
function doOnLoad(){
// init grid and set its parameters (this part as always)
myGrid = new dhtmlXGridObject('gridbox');
myGrid.setImagePath("../../../codebase/imgs/");
myGrid.setHeader("Sales,Book Title,Author,Price,In Store,Shipping,Bestseller,Date of Publication");
myGrid.setInitWidths("80,150,100,80,80,80,80,100");
myGrid.setColAlign("right,left,left,right,center,left,center,center");
myGrid.setColTypes("dyn,ed,txt,price,ch,coro,ch,ro");
myGrid.setColSorting("int,str,str,int,str,str,str,date");
myGrid.enableAutoWidth(true);
myGrid.init();
myGrid.parse(data);
//
myDataProcessor = new dataProcessor("./action?user_id=1");
myDataProcessor.setTransactionMode("POST",true);
myDataProcessor.setUpdateMode("off");
myDataProcessor.init(myGrid);
}
</script>
<input type="button" name="some_name" value="update" onclick="myDataProcessor.sendData();">
I use Java with Eclipse and jsp for my app.
What I want to implement is to:
- Insert some new rows into gantt, and click the update button for “myDataProcessor.sendData()”.
- The server-side receives the data and update database.
- Refresh gantt chart and show users the updated data.
I see my codes work for No.1 and No.2. The database is updated correctly.
and I see the server-side selects the updated data from database again in order to show the data with new ids (not temporary ids which gantt created) but the window won’t be re refreshed.
It seems I might be able to use onFullSync(), onAfterUpdateFinish, but where those events occur?
I seems the client-side receives the response after “sendData()” but how?
Please let me know if there are any samples?
Any small clues are appreciated. I tried finding any but I couldn’t eventually.
Thank you in advance.