开发者

Passing data between module and custom item renderer

开发者 https://www.devze.com 2023-02-12 03:48 出处:网络
i\'m facing with this problem: I\'ve a module containing something like this: <s开发者_运维知识库:TextInput id=\"query\"

i'm facing with this problem: I've a module containing something like this:

<s开发者_运维知识库:TextInput id="query" 
                       width="100%" 
                       minHeight="50"
                       change="doQuery"/>
          <s:List id = "items"
                  width="100%" 
                  height="100%"
                  minHeight="200" 
                  maxHeight="200"
                  itemRenderer = "renderer.myCustomRenderer"
                  dataProvider = "{itemList}"/>

my custom item renderer need to know what I'm writing into 'query' TextInput. Is there a way to pass query.text string to my renderer? Thanks a lot


You need to assign itemRenderer property at runtime when query TextInput changes :

var myRenderer:myCustomRenderer = new ClassFactory(myCustomRenderer);
sparkRenderer.properties = { query: query.text };
items.itemRenderer = sparkRenderer
0

精彩评论

暂无评论...
验证码 换一张
取 消