views:

1134

answers:

1

Hi,

I have a datagrid in which a column s having cusomized itemRenderer(textflow on canvas). Now I want to perform find text operation on each cell's textflow. For that I able to do find text operation on a focused cell. But now my requirment is to find the the text in all.

Thanks in advance.

+1  A: 

If you're using a custom itemRenderer, can you have the searchable text for it be derived from the data property? This way you can just set the dataProvider for the dataGrid and search that.

<mx:itemRenderer>
    <mx:Component>
        <ns1:customTextBox searchedText={data.searchedText} text={data.text}/>    
    </mx:Component>
</mx:itemRenderer>

Then you modify data.searchedText, which is linked to your dataProvider (remember to use an ArrayCollection so it will respond to dataChange events).

CookieOfFortune
I am able to perform the search operation but I am not able to highlight the text in that cell. As I am not able to focus that cell's custom itemRenderer, so I am not able to set selection to the text in that cell.
Hmmm... I think one way you can implement this is to modify the data itself, so that the itemRenderer knows what text has been selected, and then display based upon that.
CookieOfFortune