I have a paramaterMap and a datasource filter defined as below and they almost work as needed but is failing to properly form the query string parameter for the filter on a read operation.
When I remove the parameter map, it works fine and resolves the filter in the query string as &$filter=UserRoleId eq 3.
With the parameterMap in place, it resolves as &filter[logic]=and&filter[filters][0][field]=UserRoleId&filter[filters][0][operator]=eq&filter[filters][0][value]=3. This becomes 4 junk parameters and while this doesn't throw any errors, my odata controller does not filter when params like this are passed.
How do I get the parameterMap to return a query param of "$filter:UserRoleId eq 3" instead of the 4 junk parameters described above?
parameterMap: function (data, operation) {
if (operation !== "read" && data) {
data.UserRoleId = userRoleId;
if (operation !== "destroy") {
data.ConstraintValueId = $('#ddlConstraintValue').val();
data.ConstraintValue = null;
}
return kendo.stringify(data);
}
else
if (operation === "read" && data)
return data;
}
.
.
.
serverPaging: true,
serverFiltering: true,
serverSorting: true,
selectable: true,
filter: { field: "UserRoleId", operator: "eq", value: userRoleId },
When I remove the parameter map, it works fine and resolves the filter in the query string as &$filter=UserRoleId eq 3.
With the parameterMap in place, it resolves as &filter[logic]=and&filter[filters][0][field]=UserRoleId&filter[filters][0][operator]=eq&filter[filters][0][value]=3. This becomes 4 junk parameters and while this doesn't throw any errors, my odata controller does not filter when params like this are passed.
How do I get the parameterMap to return a query param of "$filter:UserRoleId eq 3" instead of the 4 junk parameters described above?
parameterMap: function (data, operation) {
if (operation !== "read" && data) {
data.UserRoleId = userRoleId;
if (operation !== "destroy") {
data.ConstraintValueId = $('#ddlConstraintValue').val();
data.ConstraintValue = null;
}
return kendo.stringify(data);
}
else
if (operation === "read" && data)
return data;
}
.
.
.
serverPaging: true,
serverFiltering: true,
serverSorting: true,
selectable: true,
filter: { field: "UserRoleId", operator: "eq", value: userRoleId },