I found the row templates difficult to implement in large grids, in particular with alternate shading. So I came up with some jquery solution. First of all, we need an own style
<style>
.highlight { background:yellow; }
</style>
Then we need a function that is executed inside the document.ready block that will highlight all fields with content "-1".
$(".k-grid-color").bind('click', function () {
$('td').each(function(){
if ($(this).text().indexOf('-1') > -1) {
$(this).toggleClass("highlight");
}
});
});
And we need a nice button, to switch on the light
{ text: "Color", className: "k-grid-color"}
Maybe that is of use also for some more coders.
<style>
.highlight { background:yellow; }
</style>
Then we need a function that is executed inside the document.ready block that will highlight all fields with content "-1".
$(".k-grid-color").bind('click', function () {
$('td').each(function(){
if ($(this).text().indexOf('-1') > -1) {
$(this).toggleClass("highlight");
}
});
});
And we need a nice button, to switch on the light
{ text: "Color", className: "k-grid-color"}
Maybe that is of use also for some more coders.