加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

DATAGRID Preventing enter or tab from moving onto the next c

发布时间:2020-12-15 01:30:51 所属栏目:百科 来源:网络整理
导读:Making your datagrid commit the current cell and maintain focus on that row The default behavior of editing a cell in a Flex DataGrid is such that if you hit the enter key is moves to the next cell down,and tab moves to the next cell to th


Making your datagrid commit the current cell and maintain focus on that row

The default behavior of editing a cell in a Flex DataGrid is such that if you hit the enter key is moves to the next cell down,and tab moves to the next cell to the right.

If you want it so that when you hit tab or enter,that it just commits that current cell and stays on that row in uneditted mode you'll want to combine callLater() and the itemEditEnd event.

<mx:Script>
private function maintainFocus():void
{
dg.editedItemPosition = null;
}
</mx:Script>

<mx:DataGrid editable="true" sortableColumns="false" id="dg" itemEditEnd="callLater(maintainFocus)" id="dg">......</mx:DatgaGrid>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读