Skip to content
Desislava Mihaylova edited this page Apr 28, 2016 · 3 revisions

Overview

The Configuration section demonstrates the options of a widget or other component - the supported configuration settings.

To get an idea, check out the example below.

EXAMPLE

### autoBind `Boolean` *(default: true)*

If set to `false`, the widget will not bind to the data source during initialization. In this case, data binding will occur when the [`change`](/api/framework/datasource#events-change) event of the data source is fired.

By default, this option is set to `true` which means that the widget will bind to the data source specified in the configuration.

> Setting the `autoBind` option to `false` is useful in scenarios where multiple widgets are bound to the same data source. Disabling automatic binding will ensure that the shared data source does not make more than one request to the remote service.

#### Example - disable automatic binding

    <div id="grid"></div>
    <script>
    var dataSource = new kendo.data.DataSource({
      data: [ { name: "Jane Doe" }, { name: "John Doe" }]
    });
    $("#grid").kendoGrid({
      autoBind: false,
      dataSource: dataSource
    });
    dataSource.read(); // "read()" will fire the "change" event of the dataSource and the widget will be bound
    </script>

Each configuration option must be listed. The type of the option is specified in a markdown code block. The type is required. If not specified, the CI build will fail. For a list of all available types, see the end of this document. Specify the default option value, if any.

Composite Options

Composite options are declared by nesting their members as demonstrated in the example below.

EXAMPLE

### columns `Array`

A collection of column objects or collection of strings that represents the name of the fields.

### columns.field `String`

The name of the field to which the column is bound.

First specify the name of the composite option. The type should be set to either Object or Array. Then list the fields using ### sections.

Composite Options Re-Usage

Nested configuration settings can be reused by extracting them in an common class.

Important

The class name should end with Options such as FillOptions and StrokeOptions.

For example, the Circle.fill and Path.fill share a common FillOptions class.

EXAMPLE

## Configuration

### fill `kendo.dataviz.drawing.FillOptions`

The fill options of the shape.