Tried to research this the best I could, but couldn't find a basic example. I have an ASP MVC 3 project with a Telerik Grid. Some of the columns of the grid are hidden because of space constraints. There is a separate UI element that should allow the user to select filter values for all the columns, visible or hidden. I know there must be a way to control the filtered contents of the grid from outside the View on the Client side - this telerik help page states:
filterBy:
Returns the current filter expression of the grid. The initial value is "" (empty string). Check the filter JavaScript method for additional reference.
But I can't find the additional reference. From what I can glean from the web I should do something like this:
var grid = $("#Grid").data("tGrid");
grid.filter("OrderID~eq~10248");
But when it tries to execute I get the following JavaScript error:
grid.filterBy is not a function
What am I doing wrong? And can someone point me to the details of the filterBy method?
EDIT:
I changed my code to:
$("#btnFilter").click(function (e) {
var grid = $("#Grid").data("tGrid");
grid.filter("Off_Plan~eq~'No Funds'");
});
Still get the same kind of error: grid.filter is not a function
Obviously I am newbie at telerik. Seems like I am missing some telerik javascript files...? I started this Visual Studio project as a new Telerik MVC Application. The script registrar is there and I've added to the _Layout.cshtml. Groan...