Getting started with JS DropDownList

29 Aug 20222 minutes to read

Load on demand feature allows the DropDownList items load on request from the service/database, during only on click the DropDown icon or DropDownList. This functionality helps to improve performance on control initial rendering time. Because data items load on request.

The loadOnDemand property is used to enable or disable the load on demand functionality of the DropDownList.

  • HTML
  • <input type="text" id="dropdown1" />
  • JAVASCRIPT
  • var target;
            
    		$(function() { 
                var items = [{
                    text: "ListItem 1",
                    value: "item1"
                }, {
                    text: "ListItem 2",
                    value: "item2"
                }, {
                    text: "ListItem 3",
                    value: "item3"
                }, {
                    text: "ListItem 4",
                    value: "item4"
                }, {
                    text: "ListItem 5",
                    value: "item5"
                }];
            $('#dropdown1').ejDropDownList({
                dataSource: items,
                fields: {
                    text: "text",
                    value: "value"
                },
                loadOnDemand: true
            });

    JS DropDownList LoadOnDemand