ListBox: Returning data items in order

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

    Posted 18 Aug 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?

    Thanks.

  2. Stefan
    Admin
    Stefan avatar
    1147 posts

    Posted 22 Aug 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:

    http://docs.telerik.com/kendo-ui/knowledge-base/list-box-reordering-not-working

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

    http://dojo.telerik.com/Edeco/10

    I hope this is helpful.

    Regards,
    Stefan
    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