padh
padh

Reputation: 95

How to find the specific word in kendo UI grid in MVC

I have Kendo UI Grid in MVC4 Project. After data binding, i want to check the each and every cells, whether it contains specific words like "AA" or "BB". If words found, need to change the color of that row.

Upvotes: 0

Views: 165

Answers (1)

OnaBai
OnaBai

Reputation: 40887

You can use jQuery and build a selector as:

var grid = $("#grid").data("kendoGrid");
// Color cell containing AA
grid.tbody
    .find(":contains('AA')")
    .closest("td")
    .css("background", "red");

// Color rows containing BB
grid.tbody
    .find(":contains('BB')")
    .closest("tr")
    .css("background", "red");

See it action here : http://jsfiddle.net/OnaBai/Abv97/1/

Upvotes: 1

Related Questions