Closed wonhyoung05 closed 4 years ago
Hello,
Thank you for the test case.
The bug is not in delRowData.
The problem you have is in the grid settings.
You have at the same time
datatype:'local',
loadonce: true,
...
loadonce true does not have sense when the datatype is local, since local data is always present in data parameter.
loadonce have sense only if you load the data from the server and want to make it local.
To solve the problem remove loadonce:true from the both grid settings.
It seems to be a small problem in refreshIndex in case these parameters are set.
I will look at this.
Kind Regards, Tony
Thank you for response.
After erasing 'loadonce: true', the issue is not occurs.
But there is another issue.
Scenario 1 works well. But Scenario 2 and Scenario 3 has issues. Please refer below.
Scenario 1 :
Scenario 2 :
Scenario 3 :
Move the row with id 11 from grid1 to grid2. ( drag and drop ) The row id is "dnd_xxx". < tr id="dnd_xxx" ... >
Move the row with id 23 from grid2 to grid1. ( drag and drop ) $("#jqGrid2")[0].p._index is changed. $("#jqGrid2")[0].p._index have "11", not "dnd_xxx"
Move the row with id 11 from grid2 to grid1. ( drag and drop ) In delRowData(), "dnd_xxx" row's data is not removed from $t.p.data.
Sort rows of grid2 by 'ID 2'. ( click 'Id 2' )
The "11" row is displayed in grid 2 again.
At Scenario 2 step 2, While the addJSONData() function redraws rows, the row's id is changed. "dnd_xxx" => "11" But $("#jqGrid2")[0].p._index still have "dnd_xxx", not "11".
At Scenario 3 step 2, The
When deleting a row, if
Thanks for the investigation.
Currently you can omit this problem if you set autoid to false. The problem is that you have key true in colModel, but in the same way you force generation of id from the gridDnD.
To resolve do the following:
...
jQuery("#jqGrid1").jqGrid('gridDnD',{connectWith:'#jqGrid2', autoid : false});
jQuery("#jqGrid2").jqGrid('gridDnD',{connectWith:'#jqGrid1', autoid : false});
...
I found the issue that deleted row is show again. I attached the 'index_dnd_html.txt'. index_dnd_html.txt Full working demo here: delete_demo.zip
The test scenarios are:
It seems that the issue has occurred because $t.p.data did not updated in function delRowData.
Please refer to comments in the code.
js/jquery.jqGrid.js