update action works as expected; But when I do either delete or insert that operation is executed correctly, BUT after that communication with server stops?! Response methods are same for update, insert and delete. In debug window it reaches:
row 6 marked [deleted,valid]
Initiating data sending for all rows
And nothing happens further. Actions on the grid are still possible but no syncing
After more detailed testing it turns out that some problems still persist: grid stops working.
Can you share code for proper reinitialization of grid and dataprocessor? Btw, I’m sending all modified data to the server (NOT row by row) docs.dhtmlx.com/doku.php?id=dhtm … aprocessor
Can you share code for proper reinitialization of grid and dataprocessor?
You can find such example at your dhtmlxGrid package dhtmlxGrid\samples\04_dataprocessor\
Have 10 rows in my grid;
When I erase 1 of the rows it turns out that it had sid=6 and tid=10 (value from DB) in response;
Right after that when I insert a row and hard-code sid=6 and tid=10 -it works!
BUT values of sid and tid in practice are different, for assigned by:
-grid it’s 1302803179371
-DB it’s 10
For type i use inserted, updated, deleted and I implemented appropriate response methods
How to generate proper sid? Response is dependent on that value and, as it’s currently incorrect, breaks further functionality of the grid.
In this case 1302803179371 != 6 but should be
Where
type - the type of the operation (it may be “insert”, “update”, “delete”);
sid - the original id of the row (the same as gr_id);
tid - the id of the row after the operation (may be the same as gr_id, or some different one - it can be used during a new row adding, when a temporary id created on the client side is replaced with the id taken from the DB or by any other business rule).
You can regenerate proper id when you adding row:
mygrid.addRow(“proper_id”,"");
How will proper_id look fully depends on your business rule
Seems that grid is picky about proper proper_id. How to make it same as sid?
My add function look like:
function addRow(){'
// var newId = (new Date()).valueOf();
var newId = mygrid.getRowsNum()+1;
mygrid.addRow(newId,"",mygrid.getRowsNum());
mygrid.selectRow(mygrid.getRowIndex(newId),false,false,true);
};
After inserting there comes the response, but grid dies after. See last line of the log, please
Current mode: off
Log:
row 8 marked [inserted,valid]
row 8 marked [updated,valid]
row 8 marked [updated,valid]
row 8 marked [updated,valid]
row 8 marked [updated,valid]
row 8 marked [updated,valid]
row 8 marked [updated,valid]
row 8 marked [updated,valid]
row 8 marked [updated,valid]
row 8 marked [updated,valid]
row 8 marked [updated,valid]
row 8 marked [updated,valid]
Initiating data sending for all rows
Sending all data at once
Server url: http://localhost:8080/JavaServlet/parameter1/ parameters
Server response received details
Action: inserted SID:8 TID:10
row 6 marked [updated,valid]
How comes that
row 6 marked [updated,valid]
and not
row 8 marked [updated,valid]
or
row 10 marked [updated,valid]
?
Where is that value 6 came from?
When response from server is hard-coded to that value, grid remains alive!
Just to clarify, after INSERT i do an UPDATE on same row and last line of the log is for that action; When want to sync with server again (to submit that update action) -it doesn’t work
Regards
Get a guaranteed answer from DHTMLX technical support team
under the most suitable support plan