ParamQuery grid support forum
General Category => Help for ParamQuery Pro => Topic started by: luckduck on November 17, 2020, 01:12:21 pm
-
If you double-click an empty cell without a value (editing begin) and then enter or move to another cell (editing end), it is recognized as changed even though there is no changed value.
https://paramquery.com/pro/demos/editing_batch
1. Add one blank cell in the batch editing demo above
{
title: "Unit Price", width: 100, dataType: "float", dataIndx: "UnitPrice",
validations: [{ type: 'gt', value: 0.5, msg: "should be > 0.5" }],
render: function (ui) {
var cellData = ui.cellData;
if (cellData != null) {
return "$" + parseFloat(ui.cellData).toFixed(2);
}
else {
return "";
}
}
},
{
title: "TEST", width: 100
},
2. Test cell double click
3. Click Enter or Tap or click elsewhere
4. There is no change in the value of the test cell, but it is displayed as changed.
How do I mark it as unchanged?
Thank you.
-
When nothing is entered in the editor, editor value is returned as "" which doesn't match with previous null or undefined value and the cell is marked as dirty.
To prevent it, column.editor.getData callback can be used.
editor:{
getData: function(ui){
var val = ui.$cell.find(".pq-cell-editor").val();
return val===""? null: val;
}
}
-
Thank you.
I applied the source but it is the same as before.
https://jsfiddle.net/kgfp5vs4/
Thanks.
-
Please change from null to undefined.
editor:{
getData: function(ui){
var val = ui.$cell.find(".pq-cell-editor").val();
return val===""? undefined: val;
}
}
https://jsfiddle.net/6avcn42k/