FIXED (sort of…):
Basically what was happening was that when I try to deactivate individual cells within a list of a combo box it would break down in a for loop due to null cell renderer references, I think this had something to do with the fact that when you reference the combo box dropdown, which is a list, you’re only getting a reference to that list through a getter, which may work at first but doesn’t seem too stable.
So in short I got around this by just using a list and creating a button above it that looked like a combo box, then I would just toggle the list visibility when you click the combo.
So it seems cell renderer and combobox don’t get along too well
SEE PROBLEM BELOW:
Hi,
I’m trying to disable certain rows within a combobox dropdown, the problem I run into is if I have too many items within my combobox the Cell Renderer traces out null after about 4 or 5 items ( when I have 5 + ).
Has anyone had any luck with custom comboboxes or any pointers for working with ComboBox, SimpleCollectionItem and CellRenderer?
example:
var item:SimpleCollectionItem = storeCmb.getItemAt(i) as SimpleCollectionItem;
var cr:CellRenderer = storeCmb.dropdown.itemToCellRenderer( item ) as CellRenderer;
cr.enabled = false;
EDIT:
Changing the code to this helped:
var item:SimpleCollectionItem = storeCmb.getItemAt(i) as SimpleCollectionItem;
// Added
var list:List = storeCmb.dropdown as List;
var cr:CellRenderer = storeCmb.dropdown.itemToCellRenderer( item ) as CellRenderer;
cr.enabled = false;
EDIT:
it broke again… ■■■■ combobox!