I have an ASP.NET MVC project. In one view there is a Kendo Grid named FullNameList
and there is only one column named FullName
, there is bunch of data inside the grid; all of them are simple string names. I want to know if there is a method to check whether the kendo grid contains an specific item or not? If not how can I iterate through datasource items to check one by one the items?
I have an ASP.NET MVC project. In one view there is a Kendo Grid named FullNameList
and there is only one column named FullName
, there is bunch of data inside the grid; all of them are simple string names. I want to know if there is a method to check whether the kendo grid contains an specific item or not? If not how can I iterate through datasource items to check one by one the items?
- i must add that i have read bunch of questions related to kendo grid to find the answer with similar or a little different question but i couldn't figure it out. – yekanchi Commented Aug 12, 2018 at 7:33
1 Answer
Reset to default 9In the client (i.e. browser) the data source data can be searched using javascript Array some
method:
var searchName = "Yekanchi";
var searchNameFound = $("#FullNameList").data("kendoGrid").dataSource.data().some(
function (dataItem) {
return dataItem.FullName == searchName;
});
Some
The
some()
method tests whether at least one element in the array passes the test implemented by the provided function. It returns a Boolean value.