Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Pravu Mishra on Jul 14, 2009 06:09
open dhtmlx forum
How to get Number of rows saved or updated

Hi,

I am using "myDataProcessor.sendData();" for saving bulk records.

Is there a way to display or comunicate the user the number of records saved(inserted, updated and deleted) into the database?

Thanksand Regards,
Pravu Mishra.

Answer posted by Alex (support) on Jul 14, 2009 08:50

Hello,

there is onBeforeUpdate event. It occurs each time the record is send to the server. You can use it to get the number of updated rows.

var num = 0;

dp.attachEvent("onBeforeUpdate",function(rowId,state){
  num++;
  return true
}) 

function save(){
  num=0;
  dp.sendData()

}

Answer posted by Pravu Mishra on Jul 14, 2009 08:58

Hi ,

This script looks like a client side count of records.

I need to get a message from the server regarding the number of records saved(inserted, updated or deleted).

Thanks and Regards,

pravu Mishra.

 

Answer posted by Alex (support) on Jul 14, 2009 09:17

If you send all data at once (dp.setTransactionMode("POST",true)), you can pass the number of updated rows in the response xml.

Please, see details in the documenttation:

http://dhtmlx.com/docs/products/dhtmlxGrid/doc/articles/Dataprocesor_usage.html#temu1