Hi,
In my grid I have 10 rows, the value in 1-9 rows - 2nd column, when modified, updates the value in 10th row’s 2nd column(i.e. the value adds up).
The issue which I am facing is, after data is modified in first place, lets say for 1st,2nd & 3rd row, 10th row is updated as well with the total value, status being set to updated and data for the 4 rows, i.e. 1,2,3 & 10 are saved to db successfully, thereafter, when i again modify other rows(without refreshing the page or loading the updated data from db), i.e. 4,5,6,7,8 & 9 the total value gets updated in 10th row of the grid on the page, however when I save the data to db then 10th row data does not gets updated.
I did try printing the (row)ids and it did not show 10th row id during second save.
The status of 10th row is being set as below in doCalc function:-
myDataProcessor.setUpdated(10,true,“updated”);
Saving data to db is done using below lines of code:-
function save(){
myDataProcessor.sendData();
return true;
}
the grid initialization code is as below:-
mygrid = new dhtmlXGridObject(‘gridbox’);
myDataProcessor = new dataProcessor(“myAction.java”);
myDataProcessor.setTransactionMode(“POST”,true);
myDataProcessor.setUpdateMode(“on”);
myDataProcessor.init(mygrid);
If anyone can provide some way such that same row can be saved second time without refreshing the page.
I also tried the following code in my save function, i.e. after dataprocessor sends the data to db set the updated status of all rows to false, but it did not help except setting the text to normal, from bold :-
function save(){
myDataProcessor.sendData();
var rows = mygrid.getRowsNum();
for (var i = 0; i < chngIds; i++) {
myDataProcessor.setUpdated(i+1,false);
}
return true;
}
Thanks in advance.
Steve