EasyUI,点击开启编辑框,并且编辑框获得焦点的方法


复制代码 代码如下:

onClickRow : function(rowIndex, rowData){
     var editor = $('#datagrid').datagrid('getEditor', {index:rowIndex,field:"buyNum"});
     editor.target.focus();
 }

点击一行,开启编辑框的同时,将光标放在编辑框中。

rowIndex:是开启编辑框这行当前页的行索引,从0开始;

buyNum:是开启编辑框的字段的名字。

以上就是个人总结的一个小技巧,希望大家能够喜欢。


« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3