Hi,
I have this code in a Item Renderer:
override public function set data(value:Object):void
{
super.data = value;
if(value == null) return;
/*if(value.hasOwnProperty('label')) {
label = String(value.label);
} else {
label = String(value);
}*/
label = String(value.label);
/*if(value.hasOwnProperty('href')) {
href = String(value.href);
}*/
href = String(value.href);
COMPILE::JS
{
if(textNode != null)
{
textNode.nodeValue = label;
}
}
}
The commented code is not working. So I committed the line just below to
get it working for now.
I'm passing typed object in the dataProvider :
package vos
{
public class NavigationLinkVO
{
[Bindable]
public var label:String;
[Bindable]
public var href:String;
public function NavigationLinkVO(label:String, href:String)
{
this.label = label;
this.href = href;
}
}
}
And the dataProvider is:
private var _mainNavigation:Array = [
new NavigationLinkVO("About", "https://getmdl.io/index.html
"),
new NavigationLinkVO("Getting Started", "
https://getmdl.io/started/index.html"),
new NavigationLinkVO("Components", "
https://getmdl.io/components/index.html"),
new NavigationLinkVO("Customize", "
https://getmdl.io/customize/index.html")
];
So, "label" and "href" are properties in the object, so why
"hasOwnProperty" is not working? is a bug?
Thanks
--
Carlos Rovira
http://about.me/carlosrovira