开发者

Flex AdvancedDatagrid editable but not allowed to change data

开发者 https://www.devze.com 2023-03-16 19:59 出处:网络
I have an advanced datagrid, but I want users to allow to copy some lines they want. when I use the property editable they are allowed to select the text they need, but they also are allowed to edit t

I have an advanced datagrid, but I want users to allow to copy some lines they want. when I use the property editable they are allowed to select the text they need, but they also are allowed to edit this. How can I prevent that?

I want users to be able to select开发者_StackOverflow中文版 any text in the datagrid, but they are not allowed to change the value of the grid. They should only be allowed to select and copy (ctrl + c).


One of possible solitions is:

  1. Create SelectableItemRenderer that extends AdvancedDataGridItemRenderer. In class constructor write:

    public function SelectableItemRenderer()
    {
        super();
    
        selectable = true;
    }
    
  2. Set SelectableItemRenderer as grid item renderer.


Problem solved. I've put an text input component in the item editor of the advancedDataGridColumn and that worked! Just set the advancedDatagrid editable true and on the textinput editable false!

0

精彩评论

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