dataSource Object|Array|kendo.data.DataSource
The data source of the widget. Can be a JavaScript object which represents a valid data source configuration, a JavaScript array or an existing kendo.data.DataSource instance.
If the dataSource
option is set to a JavaScript object or array the widget will initialize a new kendo.data.DataSource instance using that value as data source configuration.
If the dataSource
option is an existing kendo.data.DataSource instance the widget will use that instance and will not initialize a new one.
Example - set dataSource as an existing instance
<div id="filter-menu"></div>
<br /><br />
<div id="grid"></div>
<script>
var data = [
{ name: "Jane Doe", age: 30 },
{ name: "John Doe", age: 33 }
];
var dataSource = new kendo.data.DataSource({
data: data
});
$("#filter-menu").kendoFilterMenu({
dataSource: dataSource,
field: "age",
messages: {
and: "and",
or: "or",
filter: "Apply filter",
clear: "Clear filter"
}
});
$("#grid").kendoGrid({
columns: [
{ field: "name" },
{ field: "age" }
],
dataSource: dataSource
});
</script>