ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: lsl on October 15, 2014, 12:18:28 pm
-
There are two columns col1, col2 in a grid
In cellSave event of col1, I have the follow coding
ui.rowData["col2"]=ui.rowData["col1"]*40;
$grid1.pqGrid( "refreshCell", { rowIndx: ui.rowIndx, dataIndx: 'col2' } );
It works fine but cannot be saved in update mode because the col2 is not regard as dirty
1) col1 has a red tag but col2 no red tag.
2) In col2, ui.newVal is the same of ui.oldVal ie. the ui.oldVal is updated as the same as the new value
3) changes = $grid1.pqGrid("getChanges", { format: "raw" }), changeds.updateList not able to record the change in col2.
Does it have solution?
-
use updateRow to make changes in col2
-
I have changed as follow,
$grid1.pqGrid( "updateRow", {rowIndx: ui.rowIndx, row: { 'col2': ui.rowData["col1"]*40 }} );
$grid1.pqGrid( "refreshCell", { rowIndx: ui.rowIndx, dataIndx: 'col2' } )
it can mark the col2 as dirty. But there is another problem, the col1 is still in edit mode after tab to col2. So that both col1 and col2 are in edit mode now.
How to solve this?
-
There is no such known issue.
Please share a jsfiddle:
http://jsfiddle.net/paramquery/467uvjz7/
-
Oh Yes, It works with version 2.2
I still use the previous two version, I cannot upgrade to the latest one because there are many changes involved.
For example, the changes.updateList is quite different from previous version. Is there any detail document about the difference to different version?
It may help me to upgrade more easily.