Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
770
Client Script is not working properly
posted

 

 

 

 

function

 

DropDownOpening(sender, e)

{

 

 

var

count = 0;

count = sender._itemCollection.getLength();

sender._itemCollection.remove(sender._itemCollection.getItem(3));

sender._itemCollection.remove(sender._itemCollection.getItem(2));

sender._itemCollection.remove(sender._itemCollection.getItem(1));

sender._itemCollection.remove(sender._itemCollection.getItem(0));

 

 

 

 

 

var

itm = sender._itemCollection.createItem()

itm.set_text(

 

'Sai'

);

itm.set_value(

 

'9999'

);

items are not removed properly,  i need to add items when dropdown opening

Parents
  • 24671
    posted

    I would not advise to use the above code, because for every adding and removing of an item programatically from the client-side, an automatic ASYNC postback is made, in order to syncronize the server-side collection as well. 

    What exactly is your use case? Why do you need to add (or remove, as it is shown above) items on the client, when the dropdown is opening? 

    Thanks,

    Angel 

Reply Children
No Data