Hi,
I have list box control with transferable items working.
I would like to see all items transferred to the right (destination) listbox to be automatically sorted by text of the item.
So I attached JavaScript handler to "OnClientTransferred" client side event of the source listbox.
This is portion of my code:
As you see, I can get text values from destination listbox, put them into string array and sort that array.
I just need advise on how I can now sort the content of the destination listbox.
Thanks!
I have list box control with transferable items working.
I would like to see all items transferred to the right (destination) listbox to be automatically sorted by text of the item.
So I attached JavaScript handler to "OnClientTransferred" client side event of the source listbox.
This is portion of my code:
//Sorting items in the right list box ----------------------- var items = e.get_destinationListBox().get_items(); arrTexts = new Array(); for (var i = 0; i < items.get_count(); i++) { arrTexts[i] = items.getItem(i).get_text(); } arrTexts.sort(); for (var i = 0; i < arrTexts.length; i++) { //alert(arrTexts[i]); }
As you see, I can get text values from destination listbox, put them into string array and sort that array.
I just need advise on how I can now sort the content of the destination listbox.
Thanks!