Hi
really need help here
i have input an array into a listbox, and wanted to sort it the other way ( cos the content displayed when clicked and the item in the listbox are opposite!) so the listbox will be displayed as 1. orange 2. grape 3. apple
where the original array is 1. apple 2. grape and lastly orange. I need the listbox arrangement as the content, or else upon click, the content will not match the items in the listbox.
I have tried using array.sort and realise that it doesnt affect the arrangement in listbox. With SortListBox(), i can only sort by "label"/"data" and "ASC"/"DESC". All the results focus mainly on the alphabets of the items, and does not get what i want.
Is there a method to resolve this?
i have insert some codes that i think might be related, hope it helps
thanks
- Code: Select all
// input items into listbox
function setupFeatureList() {
for(var item in fTitle){
featureList.addItem(fTitle[item]);
}
}
// this doesnt help coz theres only ASC n DESC no reverse
function sortListBox () {
featureList.sortItemsBy("label", "reverse");
}