cell value is not updated while using setValue API

Hi,

I am using data processor with grid to update data.
I have one scenario in which I am updating cell value through setValue() API. But this operation does not mark cell as modified. I tried to use setUpdated() API also as show below:

dhtmlxGridObj.cells(rowId,columnIndex).setValue(cellValue)
dhtmlxDataProcessorObj.setUpdated(rowId,true);

Could you please tell me solution to mark cell as updated?

Thanks
Vibhav

With cellUpdated method new value of a cell updates well.
PLease provide a complete demo to reconstruct an issue.

Hi,

I attached one sample to reproduce the issue.

Please follow below steps to reproduce this issue:

  1. From combo below grid, choose option 11 or 22 .
  2. Then enter the value in the textbox given and click on apply button…
  3. After setting the values to cells …click on save button
  4. Then check for the values in the Dhtmlxdataprocessor.js (debugger attached). Move to this._getRowData(id,id+this.post_delim) from grid js file. in this method though cell is updated wasChanged method returns false.

When we update this cell by clicking on it,“wasChanged” flag is true. and when we update cell using API’s it gives “wasChanged” flag as false.

I have also attached two images for the same issue.
Please check this sample and provide us solution for this issue.

Thanks,
Vibhav





cell update.rar (701 KB)

Try to modify your onRowMark event this way:

dhtmlxDataProcessorObj.attachEvent("onRowMark",function(id,state,mode){ if(state&&mode=="updated") { mygrid.forEachCell(id,function(obj){ if (obj.wasChanged()) { obj.cell.style.fontWeight="bold"; } }); return true; //instead of return 0 } return true; })

Hi,

Thanks for your reply.

But the solution that you provided is not working fine. In our case we don’t want that on changing one cell, complete row will get mark as updated.

And also on click on save button its still showing those rows as unchanged. Please have a look to attached (previous) images.

And also please check the step 4 below in the attached sample again (After updating the changes)

  1. Check for the values in the Dhtmlxdataprocessor.js (debugger attached). Move to this._getRowData(id,id+this.post_delim) from dhtmlxgrid.js file. in this method though cell is updated wasChanged method returns false.

When we update this cell by clicking on it,“wasChanged” flag is true. and when we update cell using API’s it gives “wasChanged” flag as false.

Thanks,
Amit Gupta
cell update_afterChange.rar (701 KB)

“wasChanged” flag appears only in the case of manually changed value (by a user but not by API).

Hi,

Is there any way to mark cell as modified through API. We want to change cell value by API.

Please let me know.

Thanks
Snehal

docs.dhtmlx.com/doku.php?id=dhtm … setupdated

Thanks for reply. But this API will mark whole row as updated. I don’t want to process all cells in a row. I just want to process modified cells. So I want API to mark cell as updated.

DHTMLXGrid is row based and not cell based. So i think that’s your problem.

Alternative you perhaps can use ‘setCellTextStyle(…)’

I know grid is based on row id. But if we use data processor along with grid, there is option in dataprocessor to just send modified data of row to server. This option can be enabled on data processor by enablePartialDataSend API. If this option is enabled data processor sends only modified cells from grid to server.

I am using this option for sending only modified cell data to server.
Please let me know solution to mark cells as updated so that these modified cells will be send to server.

Vibhav Agrawal,

Unfortunately the only way is to mark the updated row with the function that you’ve suggestsd in your sample.
But it won’t mark the cells(rows) which values are changed with API but not by user.