ParamQuery grid support forum
General Category => Help for ParamQuery Grid (free version) => Topic started by: 杨万里 on May 14, 2018, 10:24:46 am
-
How to change the cell data beforeValidate?
beforeValidate: function( event, ui ) {
//code change the cellData before it validate
}
or
Is there other Events to change then cell's data before validate except beforeValidate?
Thanks.
-
ui parameter in beforeValidate event is an object contaning source and rowList properties.
{
"source": "edit",
"checkEditable": false,
"rowList": [
{
"newRow": {
"ProductName": "paramquery"
},
"oldRow": {
"ProductName": "Tofu"
},
"rowData": {
"ProductID": 14,
"ProductName": "Tofu",
"QuantityPerUnit": "40 - 100 g pkgs.",
"UnitPrice": 23.25,
"UnitsInStock": 35,
"UnitsOnOrder": 0,
"ReorderLevel": 0,
"Discontinued": false,
"pq_cellselect": {
"ProductName": true
}
},
"rowIndx": 69,
"type": "update"
}
]
}
Depends on what you want to do with it. It's manipulation is done the way you normally modify plain objects and arrays.
Typical example:
if( ui.source == 'edit' ){
ui.rowList.forEach( function ( obj ){
obj.newRow.ProductName = "Hello world";
})
}
-
:) :) :) :) :)
It is work!
you gave me great help.
I really thank you very much!