Articles in this section
Category / Section

How to rebind new datasource to existing Listbox?

1 min read

By default, while rebinding the datasource to Listbox control, it automatically clears the list item first and then renders the control with the newly updated datasource.

Refer the following code examples to rebind the new datasource.


<div id="lb" data-role="ejmlistbox" data-ej-databinding="true" data-ej-datasource="window.dbitem1">


<input id="button" type="button" data-role="ejmbutton" data-ej-text="Clear" data-ej-touchend="touchEnd" />



    window.dbitem1 = [

        { "text": "Hot Singles" },

        { "text": "Rising Artists" },

        { "text": "Live Music" },

        { "text": "Best of 2013 So Far" },

        { "text": "Hip-Hop and R&B Sale"}];

    window.dbitem2 = [

        { "text": "Music" },

        { "text": "Videos" },

        { "text": "Chat" },

        { "text": "Others" }];

    function touchEnd() {


        $("#lb").ejmListbox({ dataSource: "window.dbitem2" });




Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied