Is it possible to add/remove items from the DropDownProvider/EditorControl at the client?
I have a specific set of values that are to be in the dropdown based upon the content of the WebDataGrid cell. These values are available at the client.
For example, I've attempted to clear the dropdown items from the EditorControl (ddCtl)
items.get_length()remains the same,and the items.remove(items.getItem(0)) is performing an async postback
var items = ddCtl.get_items();
while (items.get_length())
items.remove(items.getItem(0));
Any help would certainly be appreciated!
Thank you!
Hi,
If you are referring to adding and removing items on the client, add() and remove() will always do async postback, so that the server-side item collection st***nchronized with the client-side item collection.
I suggest to also try to use getLength instead of the derived get_length, because javascript objects ($IG.DropDownItem instances) are created on demand on the client, and get_length may return less than the visible number of items (html LI elements).
For totally clearing the collection, you can also try calling dispose() on the item collection, i.e. items.dispose(). For the item references themselves you can do items._items = [] , but none of this will synchronize the server-side collection of items, or change the actual HTML markup for the dropdown list.
Thanks for your feedback,
Angel
I will give your suggestions a try. I just updated the post to clarify that I'd like to do this client side (there is no server side collection to syncronize)I'll do a post back on the CellExitedEditMode - after a selection is made
Thanks for the Quick Reply ;)