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

Sortable: A-Z items

5 Answers 248 Views
MultiSelect
This is a migrated thread and some comments may be shown as answers.
Federico
Top achievements
Rank 1
Federico asked on 26 Sep 2017, 01:32 PM

how to print alphabetically items in multiselect?

<select id="item-a" data-role="multiselect"
data-value-primitive="true"
data-text-field="text"
data-value-field="id"
data-bind="value: doc,
source: sourceItem"></select>

5 Answers, 1 is accepted

Sort by
0
Nencho
Telerik team
answered on 27 Sep 2017, 08:56 AM
Hello Federico,

In order to achieve the desired functionality, you can use the sort method of the data Source applied to the multiselect. Please refer to the documentation article below, describing the usage of the sort method:

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

In addition, I have created a dojo example for you, where this implementation is demonstrated:

http://dojo.telerik.com/@nenchef/AgerA/2

Hope this would help.

Regards,
Nencho
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Federico
Top achievements
Rank 1
answered on 28 Sep 2017, 07:25 AM

It's possible to do it without angular, with only kendo ui mvvm(html5+databinding+js)?

I want it to be created datasource already in alphabetical order without function onClick.

0
Joana
Telerik team
answered on 29 Sep 2017, 08:56 AM
Hi Federico,

I have updated the dojo sample my colleague Nencho has sent you based on your requirements: http://dojo.telerik.com/upaVe . 

Let me know if you have further questions.

Regards,
Joana
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Federico
Top achievements
Rank 1
answered on 02 Oct 2017, 07:53 AM

How i can do it("datasource.sort") with mvvm?

 

products.sort({
            field: 'ProductName',
            dir: 'asc'
          });

Can i do it in the multiselect?

0
Accepted
Joana
Telerik team
answered on 04 Oct 2017, 04:24 AM
Hi Federico,

The same approach could be used in MVVM scenario for sorting the MultiSelect dataSource. Here is an updated dojo in MVVM scenario: http://dojo.telerik.com/ogaSAm

Regards,
Joana
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
MultiSelect
Asked by
Federico
Top achievements
Rank 1
Answers by
Nencho
Telerik team
Federico
Top achievements
Rank 1
Joana
Telerik team
Share this question
or