col.Field("ShipCountry").HeaderText("Ship Country").EditType(EditingType.Dropdown).Width(95).Add()
col.Field("OrderDate").HeaderText("Order Date").EditType(EditingType.Datepicker).Format("{0:MM/dd/yyyy}").Width(75).Add()
col.Field("Freight").HeaderText("Freight").TextAlign(Syncfusion.JavaScript.TextAlign.Right).Width(75).Format("{0:C}").Add()
col.Template("#columnTemplate").TextAlign(TextAlign.Center).Width(110).Add()
col.Template("#column").TextAlign(TextAlign.Center).Width(110).Add()
End Sub)
gridbuilder.ClientSideEvents(
Sub(cell)
cell.QueryCellInfo("cellinfo").ActionComplete("complete")
End Sub)
.
.
.
<script type="text/javascript">
function cellinfo(args) {
if (args.column.field == "OrderDate" && (Number(args.data.OrderDate) == Number(new Date("07/04/1996"))))
$(args.cell).addClass("green");
else if (args.column.field == "OrderDate" && (Number(args.data.OrderDate) < Number(new Date())))
$(args.cell).addClass("red");
}
function complete(args) {
if (args.requestType == "grouping") {
$($("td.e-groupcaption").get(0)).addClass("amber");
$($("td.e-groupcaption").get(1)).addClass("stop")
$($("td.e-groupcaption").get(2)).addClass("start")
}
}
</script> |
<style type="text/css">
.red{
background-color:orangered;
}
.green{
background-color:greenyellow;
}
.amber{
color:yellow !important
}
.stop{
color:red !important
}
.start{
color: green !important;
}
</style>
<script type="text/x-jsrender" id="columnTemplate">
</script>
<script type="text/x-jsrender" id="column">
</script> |
|
|