:: Forum >>

How to scroll to selected item in a Combo

How do I get a Combo to scroll to the item that has been selected so that it always appears in the drop down list?

I haven't been able to find this anywhere in the documentation.

Roger
Thursday, March 8, 2007
Roger,

Based on other examples I found here in the forum, I came up with the following code to override the showPopup function in the combo and set the current item to the selected item:

combo.AW_showPopup = combo.showPopup;
combo.showPopup = function() {
this.AW_showPopup();
var selected_item = this.getSelectedItems();
var AW_onCurrentItemChanged = this.onCurrentItemChanged;
this.onCurrentItemChanged = null;
this.setCurrentItem(selected_item);
this.onCurrentItemChanged = AW_onCurrentItemChanged;
}

Randall Severy
Saturday, March 24, 2007

This topic is archived.


Back to support forum

Forum search