Wheng using following code to set default value for pqgrid column, there is a "Uncaught TypeError: Cannot redefine property: id" problem.
The code comes from
https://paramquery.com/forum/index.php?topic=4347.0.
rowTemplate: {},
complete: function(){
let rt = this.option('rowTemplate'), cm = this.getColModel();
cm.forEach(function(col){
let def = col.defaultValue, di = col.dataIndx;
if( def !== undefined ){
Object.defineProperty(rt, di, {
enumerable: true,
get(){
var val = this[ "_" + di];
return val == null? def: val;;
},
set(val){
this[ "_" + di ] = val;
}
});
}
});
},