简体   繁体   English

当onfocusout / blur /单击另一个空间时,jqgrid退出内联单元格编辑模式

[英]Jqgrid exit inline cell edit mode when onfocusout/blur/click another space

I searched, but I could not find such a feature of jqgrid. 我进行了搜索,但是找不到jqgrid的这种功能。

I found a way and wanted to share with you. 我找到了一种方法,并希望与您分享。

The following path works for me if the item you want to edit is textarea. 如果要编辑的项目是textarea,则以下路径对我有用。

You must use the document keyword because the text area is shown later. 您必须使用document关键字,因为稍后将显示文本区域。

And to finish editing, you need to setGridParam the local data to the Jqgrid again and trigger reloadGrid method. 完成编辑后,您需要再次将本地数据设置为Jqgrid并触发reloadGrid方法。

$(document).on('blur', '.edit-cell.ui-state-highlight textarea', function () {
                var myGrid = $('#listVardiyaPlan');
                myGrid.jqGrid('setGridParam', { datatype: 'local', page: 1 }).trigger('reloadGrid');
            });

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM