Reputation: 1045
In the following ajax call,i have data in result,now i want to filter my result:
$.ajax({
dataType: "json",
type: "POST",
url: "@Url.Action("method", "controller")",
contentType: "application/json; charset=utf-8",
data: JSON.stringify({ "regionalManager": dtDrpVals.drpValue}),
success: function (result) {
var rst = new kendo.data.DataSource({
data: result,
filter: [
{ field: "presented_in_class", operator: "eq", value: "false" },
{ field: "passed_course", operator: "eq", value: "false" }
]
});
is the way i should filter ajax call?if so,why the filter is not working,i still get the same data
Upvotes: 1
Views: 247
Reputation: 27536
The configuration property filter
value is either
A single filter clause is an object with three properties
field
operator
value
A composite filter clause is an object with two properties
logic
, "and"
or "or"
filters
, an array of filters to be evaluated conjunctively using the logic value
If logic is not specified it will default to "and"
.
I presume the top level configuration filter:
value is specially examined. If the value is an array, the value will be considered a composite filter with logic and
The composite form allows nested logic such as ( A or (B and C) or (D and (E or F)) )
Upvotes: 1