首页 > 代码库 > easyui------设置datagrid('getEditor')时焦点问题

easyui------设置datagrid('getEditor')时焦点问题

代码:

var dg = $(DataGrid.TableGridID);
        var row = {
            ID: "",
            UserName: "",
            Password: "",
            IsRemembered: "",
            CreateTime: ""
        };
        dg.datagrid(‘insertRow‘, {
            index: 0,
            row: row
        });
        var selectIndex = dg.datagrid(‘getRowIndex‘, row);
        dg.datagrid(‘beginEdit‘, selectIndex);
        var ed = dg.datagrid(‘getEditor‘, { index: 0, field: ‘UserName‘ });
        $(ed.target).focus();

 

easyui------设置datagrid('getEditor')时焦点问题