We are updating cell value based on the condition and it's working fine with rowInit method.
The changes are lost after we filter on the grid. Please review the code below & attached screenshots and advise to fix this.
1_9112022.png: Data loaded with updated text in the status column based on rowInit method.
2_9112022.png: Lost changes after applying the filter. Need your help to fix this.
rowInit: function (ui)
{
if (ui.rowData.Exchange == "NSECM")
{
ui.rowData.Exchange = "NSE";
}
var lsOrderStatus = "None";
switch (ui.rowData.OrderStatus)
{
case 48:
lsOrderStatus = "None";
break;
case 49:
lsOrderStatus = "Submitted";
break;
case 50:
lsOrderStatus = "MPending";
break;
case 51:
lsOrderStatus = "EPending";
break;
case 52:
lsOrderStatus = "Freezed";
break;
case 53:
lsOrderStatus = "MRejected";
break;
case 54:
lsOrderStatus = "ERejected";
break;
case 55:
lsOrderStatus = "Cancelled";
break;
case 56:
lsOrderStatus = "ECancelled";
break;
case 57:
lsOrderStatus = "Executed";
break;
case 65:
lsOrderStatus = "ESOrder";
break;
case 66:
lsOrderStatus = "ESTrade";
break;
case 83:
lsOrderStatus = "SLPending";
break;
}
ui.rowData.OrderStatus = lsOrderStatus;
if (ui.rowData.OrderPrice > 1000)
{
return {
style: { "background": "yellow" } //can also return attr (for attributes) and cls (for css classes) properties.
};
}
else if (ui.rowData.OrderPrice > 500)
{
return {
style: { "background": "aqua" } //can also return attr (for attributes) and cls (for css classes) properties.
};
}
},
cellSave: function (evt, ui) {
this.refreshRow({ rowIndx: ui.rowIndx });
},