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

After Added Event

2 Answers 71 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Ian
Top achievements
Rank 1
Ian asked on 03 May 2019, 11:51 AM

Is there any way to detect an event AFTER an item has been added to a ListBox? The existing add event fires before the item is added.

My use case is that I have two connected ListBoxes. The second listbox contains a template that I need to run some jQuery in to modify the contents based on the item data, so the item needs to have been created before the script is run?

2 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 07 May 2019, 09:55 AM
Hello Ian,

Although that there is no specific event that will fire after the rendering of the added item, you could place a setTimeout function within the "add" event and evaluate the template there:
<script>
    $("#listBoxA").kendoListBox({
        connectWith: "listBoxB",
        toolbar: {
            tools: [ "transferTo" ]
        }
    });
 
    $("#listBoxB").kendoListBox({
        add: function(e) {
            setTimeout(function(){
              //the custom logic
            })
        }
    });
</script>


Best Regards,
Konstantin Dikov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Ian
Top achievements
Rank 1
answered on 07 May 2019, 12:45 PM
Ok, that works ok. Thanks.
Tags
ListBox
Asked by
Ian
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Ian
Top achievements
Rank 1
Share this question
or