欢迎来到山村网

datagrid不可编辑行有关问题的控制方法

2019-03-02 11:15:47浏览:818 来源:山村网   
核心摘要:datagrid不可编辑行一个更简单的办法,editable=true,然后直接把itemEditBegin给停掉阻止createItemEditor的调用------解决方案

datagrid不可编辑行一个更简单的办法,editable=“true”,然后直接把itemEditBegin给停掉阻止createItemEditor的调用

------解决方案--------------------写renderer呗,renderer里可以拿到你点的这个cell是第几行和第几列,根据行列改变DataGrid的editable属性,给你一个思路:1.renderer里监听点击事件;2.事件处理函数中从listDatadata取出行列index,进行判断(哪一行可编辑这个变量可以通过创建renderer的时候用properties传到renderer中);3.if(true),把listData.owner(或parentDocuemnt)的editable属性设为true,然后将光标放到点击的这个cell上(设editedItemPosition属性,怎么用自己去查);4.监听DataGrid的itemEditEnd事件,事件处理函数中把editable函数在设为false------解决方案--------------------(已验证)想到一个更简单的办法,editable=“true”,然后直接把itemEditBegin给停掉阻止createItemEditor的调用,听DataGrid的itemEditBegin事件代码如下:private function onItemEditBegin(event:DataGridEvent):void{if(event.rowIndex == 0)//如果是第一行,则不让编辑{event.stopImmediatePropagation();}}
(责任编辑:豆豆)
下一篇:

Flex字体加粗问题只能对英文的字体加粗

上一篇:

Flex控制弹出窗口拖动范围示例代码

  • 信息二维码

    手机看新闻

  • 分享到
打赏
免责声明
• 
本文仅代表作者个人观点,本站未对其内容进行核实,请读者仅做参考,如若文中涉及有违公德、触犯法律的内容,一经发现,立即删除,作者需自行承担相应责任。涉及到版权或其他问题,请及时联系我们 xfptx@outlook.com