dataSource Object|Array|

The data source of the widget. Can be a JavaScript object which represents a valid data source configuration, a JavaScript array or an existing instance.

If the dataSource option is set to a JavaScript object or array the widget will initialize a new instance using that value as data source configuration.

If the dataSource option is an existing 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>
  var data = [
      { name: "Jane Doe", age: 30 },
      { name: "John Doe", age: 33 }

  var dataSource = new{
    data: data

    dataSource: dataSource,
    field: "age",
    messages: {
        and: "and",
        or: "or",
        filter: "Apply filter",
        clear: "Clear filter"

    columns: [
      { field: "name" },
      { field: "age" }
    dataSource: dataSource
In this article