ListBox: Returning data items in order

2 posts, 0 answers
  1. Eric
    Eric avatar
    1 posts
    Member since:
    Mar 2011

    Posted 18 Aug 2017 Link to this post

    I initially would have expected that the dataItems() method would have returned the items in the order that they appear in the list box.  However, the method does not.  Are there any plans to change this?  The best work around I can come up with is

    var selectCols = $('#list`).data('kendoListBox');

    selectCols.items().map(function(i, e) { return selectCols.dataSource.getByUid($(e).data('uid')); })

    Is there a better, more durable approach that leverages public API's?


  2. Stefan
    Stefan avatar
    1590 posts

    Posted 22 Aug 2017 Link to this post

    Hello Eric,

    For now, this behaviour is expected and changing it is not in our short-term ToDo list.

    We have a knowledge-base article which demonstrates how to keep the items indexes in sync:

    I modified it to demonstrate how the new result of the dataItems method will look after a reorder:

    I hope this is helpful.

    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.
Back to Top