I’ve got a list box where each item can have one of two different icons. It works perfectly well when I set the icon at the time I add the item to the list, but change the property that determines which icon will show and use the .redraw() method, it does nothing until the mouse rolls over that item in the listbox. It’s cooky, I tell you.
The “data” for each list item is an XML node. One of the attributes (“hasPhoto”) determines the icon to use (see “listFlash.iconFunction” definition below). It’s pretty straightforward and works very well, as long as I’m not changing icons on existing list items.
Here are the key bits of code that I have right now:
// function to check xml data and determine symbol for icon
listFlash.iconFunction = function( item ){
if( item.data.attributes.hasPhoto == "yes" )
return "HasPictureIcon";
else
return "NeedsPictureIcon";
};
// initially, the list item xml data "hasPhoto" == "no"
listFlash.selectedItem.data.attributes.hasPhoto = "yes";
listFlash.redraw();
I also tried .invalidate(), but it does the same thing.
I’m stuck. If anyone has any ideas, I’d greatly appreciate it!
Thanks!