Posted 24 October 2017, 9:37 am EST
OK, I have thought I was pretty nifty when I put this together until I filtered:
<style>
.OverShip {
background-color: #ff6666 !important;
}
</style>
...the grid...
<script type="text/javascript">
$(function () {
var flex = wijmo.Control.getControl("#flexGrid");
flex.rows.forEach(function (row) {
if (row.dataItem.QtyOnOrder < row.dataItem.QtyInvoiced) {
row.cssClass = "OverShip";
}
});
}
</script>
It looks great when I run the page, but when I filter the page the CSS is overridden!
I have tried to use this:
.Filterable(f=> f.OnClientFilterChanged("changing"))
when creating the grid using HTML helpers with a function:
function setRowColors() {
console.log("filtering");
var flex = wijmo.Control.getControl("#flexGrid");
flex.rows.forEach(function (row) {
if (row.dataItem.QtyOnOrder < row.dataItem.QtyInvoiced) {
row.cssClass = "OverShip";
}
});
}
function changing(s, e) {
setRowColors();
}
But that doesn’t do anything! How can I persist the color formatting I want?