Kendo Ui combobox - set default value

user3573096 picture user3573096 · Dec 10, 2014 · Viewed 11.6k times · Source

I successfully filled my combobox. But now I'm trying to set default value for combobox. For example let's say third value from source. This is my input and datasource:

<script>
viewModel.dataSourceType = new kendo.data.DataSource({
    transport: {
        read: {
            url: "/api/Type/Get",
            dataType: "json"
        }
    },
    schema: {
        id: "Id",
        data: "Data",
        model: {
            id: "Id",
            fields: {}
        }
    }
});

<input id="type"
 data-role="combobox"
 data-value-primitive="true"
 data-auto-bind="true"
 data-text-field="Name"
 data-value-field="Id"
 data-bind="value: model.Id, source: dataSourceType">

It's probably really easy but I'm strugling with that. Thank you.

Answer

Petur Subev picture Petur Subev · Dec 10, 2014

I assume you look for the index configuration option.