Articles in this section
Category / Section

Is it possible to differentiate the user selection or programmatically selection of the items in the DropDownList?

1 min read


Yes, It’s possible to differentiate the selection of items in DropDownList using “isInteraction” argument in the select event of DropDownList.


If the value of “isInteraction” is true , then the item has been selected by user interaction. Otherwise it has been selected by properties or methods such as “selectItemByText”, “selectItemByValueor “selectItemByIndicesin the DropDownList.


Initialize the DropDownList as follows


<div class="ctrllabel">Select a car</div>

        <input type="text" id="selectCar" />

        <div id="carsList">


                <li>Audi A4</li>

                <li>Audi A5</li>

                <li>Audi A6</li>

                <li>Audi A7</li>

                <li>Audi A8</li>




        <button id="button21">Select</button>

var target;

        $(function () {

            target = $('#selectCar').ejDropDownList({

                targetID: "carsList",

                width: "150px",

                select: "onSelect"




                showRoundedCorner: true,

                size: "mini",

                click: "onClick"




Upon selecting the items in the DropDownList, the client side event “select” will be triggered, in that check whether the value of isInteraction argument is true or not.  If the value is true, the item has been selected by user(selected through the mouse hover).



function onSelect(args) {


            if (args.isInteraction)

                alert("The item " + args.value + " has been selected by user");


                alert("The item " + args.value + " has been selected programmatically");



        function onClick(args) {

            target.selectItemByValue("Audi A7");



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