Flex ~ ComboBox length, set selectedIndex example

this is a example if combobox item's SkuID == p.mainSkuID

then set index


Action Script
for(var i:int =0; i < MainSkuID.dataProvider.length; i++){
if(MainSkuID.dataProvider[i].@SkuID == p.mainSkuID)
{
MainSkuID.selectedIndex = i;
}
}

MXML
<mx:ComboBox labelField="Label" id="MainSkuID" >
</mx:ComboBox>


http://flex.sys-con.com/node/312098

沒有留言:

發佈留言