Unplanned
Last Updated: 20 Mar 2023 18:22 by ADMIN
n/a
Created on: 20 Mar 2023 18:14
Category: ListBox
Type: Feature Request
1
Add new ListBox items to top
I need to add new items to the top of the ListBox.

Could you please implement this functionality?
1 comment
ADMIN
Stoyan
Posted on: 20 Mar 2023 18:22

Hi Bharat,

Thank you for your request. 

We evaluate which features to implement based on community interest. Therefore I encourage anyone who also needs this feature to vote for its implementation.

In the meantime here is one workaround:

  1. Subscribe to the Add Event of the ListBox
  2. In the handler prevent the original event and iterate the dataItems that where about to be added.
  3. Apply the internal _addItemAt method of the ListBox to each item. The second parameter of the method is the index at which the item is going to be added.

         function onAdd(e) {
             e.preventDefault();
             e.dataItems.forEach(dataItem=>{
                 e.sender._addItemAt(dataItem,0)
             })
         }

 

Regards,
Stoyan
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.