1
Help for ParamQuery Grid (free version) / Re: Set background color of entire row (add css class) depending upon cell data
« on: October 03, 2017, 12:11:27 pm »
You can use Jquery once the grid has been rendered (grid = $('#myGrid')):
<script>
grid.on( "pqgridrefresh", function( event, ui ) {
$(".pq-grid-row").each(function( index ) {
var rowData = grid.pqGrid( "getRowData", {rowIndxPage: index} );
if(rowData.expiredDate){//if there exists and expiredDate, paint that row in red
//alert("fila de baja:"+index)
$(this).removeClass('pq-grid-oddRow');
$(this).removeClass('pq-grid-row');
$(this).addClass('redRow');
}
});
} );
</script>
<script>
grid.on( "pqgridrefresh", function( event, ui ) {
$(".pq-grid-row").each(function( index ) {
var rowData = grid.pqGrid( "getRowData", {rowIndxPage: index} );
if(rowData.expiredDate){//if there exists and expiredDate, paint that row in red
//alert("fila de baja:"+index)
$(this).removeClass('pq-grid-oddRow');
$(this).removeClass('pq-grid-row');
$(this).addClass('redRow');
}
});
} );
</script>