I am new to kendo and I am in a situation where I have a kendo grid bound to a data source and I need to add a custom filter to it.
The filter should have a dropdownlist that has distinct values from the column "Issuer". How can I achieve this without making another server call to get distinct Issuer values. I want to bind the dropdownlist to the existing data source which already has all the data. Please suggest.
Here's my code:
$("#DivGrid").kendoGrid({
dataSource: {
transport: {
read: {
url: "/DataView/GetData",
dataType: "json"
},
parameterMap: function (options, operation) {
if (operation !== "read" && options.models) {
return { models: kendo.stringify(options.models) };
}
else if (options) {
var kendoString = kendo.stringify(options);
return { models: kendoString };
}
}
},
pageSize: 10,
schema: {
model: {
tranId: "id",
fields: {
tranId: { editable: false, nullable: false },
issuer: { editable: false },
dateAdded: { editable: false, type: "date" }
}
}
}
},
filterable: true,
columns: [
{
field: "tranId",
title: "TranId",
width: "30px",
},
{
field: "issuer",
title: "Issuer",
width: "50px",
},
{
field: "dateAdded",
title: "Created Date",
format: "{0:MM-dd-yyyy hh:mm:ss}",
width: "40px",
},
],
dataBound: function (e) {
//something
},
pageable: {
alwaysVisible: false,
refresh: false,
pageSizes: true,
buttonCount: 3
},
});