This is a migrated thread and some comments may be shown as answers.

Kendo Combobox Angular Directive - how to set sort order?

1 Answer 547 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Saquib
Top achievements
Rank 1
Iron
Iron
Iron
Saquib asked on 17 Dec 2015, 09:15 AM

Hi

 Using the kendo-combo-box as show below, how can I specify a sort order for the generated select box ?

 Thanks!

<select id="Team_Select" class="form-control" kendo-combo-box
    k-placeholder="'Select team'"
    k-data-text-field="'Description'"
    k-data-value-field="'ObjectNumber'"
    k-filter="'contains'"
    k-auto-bind="false"
    k-min-length="3"
    k-data-source="Persons"
    ng-model="Filters.Team_Select">
</select>

1 Answer, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 18 Dec 2015, 10:59 AM
Hi,

You may try to sort the datasource:

{
    data:[
        { setorNome: "bbb", setorId: 1 },
        { setorNome: "aaa", setorId: 2 },
        { setorNome: "eee", setorId: 3 },
        { setorNome: "ccc", setorId: 4 },
        { setorNome: "ddd", setorId: 5 }],
    sort:{field:"setorNome", dir:"asc"}
}

http://docs.telerik.com/kendo-ui/api/javascript/data/datasource#methods-sort

Regards,
Helen
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
ComboBox
Asked by
Saquib
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Helen
Telerik team
Share this question
or