pasluc74669 pasluc74669 - 10 months ago 74
Javascript Question

kendo grid How to get a row by field value

I need to get a row(s) from my kendo grid, using a string as parameter to filter rows.
the grid model is:

id: "id_tipo_pagamento",
fields: {
id_tipo_pagamento: { type: "number", editable: false },
desc_tipo_pagamento: { type: "string"}

i tried this, but isn't working:

var grid = $("#kendoGrid").data("kendoGrid");
var row = grid.tbody.find("tr[desc_tipo_pagamento=test]");

Answer Source

Instead of using DOM, I would suggest using jQuery.grep on the array (if you want all) or in DataSource.view if you want from the current visible ones.


// Retrieve all data from the DataSource
var data =;
// Find those records that have desc_tipo_pagamento set to "test"
// and return them in `res` array
var res = $.grep(data, function (d) {
    return d.desc_tipo_pagamento == "test";

res will contain a reference to the records in DataSource that matched the condition.