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

Reordered ListBox showing original order

1 Answer 83 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 07 Jun 2017, 06:45 PM

I've started using the ListBox. I noticed today that when I reordered a list using the up/down buttons, that the order doesn't update to the dataSource. Which makes sense, but is there a way to loop through the contents of the ListBox, so can update back to the database the new order?

var selectedFields = $("#selectedFields").data("kendoListBox");
var dataSource = selectedFields.dataSource;

As you can see from the screenshots, CADWorx Id is listed 1st on the screen, but in the dataSource, it still shows Lg. Description 1st.

 

Thanks,

Neil

1 Answer, 1 is accepted

Sort by
0
Milena
Telerik team
answered on 09 Jun 2017, 12:50 PM
Hello,

You can achieve your goal as handle dragend event of ListBox. There you can access dataitem and datasource(using e.sender) from event aruments and manipulate them according to your recuirements.

Regards,
Milena
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
ListBox
Asked by
Neil
Top achievements
Rank 1
Answers by
Milena
Telerik team
Share this question
or