flex edit menu operations on multiple textareas

2019-07-23 15:20发布

问题:

I have a grid in which one column is having itemrenderer as textarea. My application is menu controled. Now I want to perform edit operations on the textarea using menu items.

Like if I select some text from a textarea in the grid, then I select a menu item "Cut" then it should cut the selected text from the textarea. In this manner I would lie to perform all operations.

I am not getting how to get that the operation is to be performed on which textarea?

回答1:

inside your menu item click handler, try:

var fcs:IFocusManagerComponent = focusManager.getFocus();
if(fcs is TextArea)
{
    var txt:String = TextArea(fcs).text;
    System.setClipboard(txt);
}


标签: flex3 air