Extjs Grid 回车换行事件
来源:互联网 发布:网络分销合法吗 编辑:程序博客网 时间:2024/05/29 17:05
光标在行上横着走
Ext.override(Ext.grid.RowSelectionModel, {
onEditorKey : function(field, e) {
// alert('go');
var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
var shift = e.shiftKey;
Ext.log('k:' + k);
if (k == e.ENTER) {
e.stopEvent();
ed.completeEdit();
if (shift) {
newCell = g.walkCells(ed.row, ed.col - 1, -1,
this.acceptsNav, this);
} else {
// alert('go');
newCell = g.walkCells(ed.row, ed.col + 1, 1,
this.acceptsNav, this);
}
} else if (k == e.TAB) {
e.stopEvent();
ed.completeEdit();
if (this.moveEditorOnEnter !== false) {
if (shift) {
newCell = g.walkCells(ed.row - 1, ed.col, -1,
this.acceptsNav, this);
} else {
// alert('go');
newCell = g.walkCells(ed.row + 1, ed.col, 1,
this.acceptsNav, this);
}
}
} else if (k == e.ESC) {
ed.cancelEdit();
}
if (newCell) {
g.startEditing(newCell[0], newCell[1]);
}
}
});
var sm2 = new Ext.grid.RowSelectionModel({
moveEditorOnEnter : true,
singleSelect : true,
listeners : {
rowselect : function(sm, row, rec) {
centerForm.getForm().loadRecord(rec);
}
}
onEditorKey : function(field, e) {
// alert('go');
var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
var shift = e.shiftKey;
Ext.log('k:' + k);
if (k == e.ENTER) {
e.stopEvent();
ed.completeEdit();
if (shift) {
newCell = g.walkCells(ed.row, ed.col - 1, -1,
this.acceptsNav, this);
} else {
// alert('go');
newCell = g.walkCells(ed.row, ed.col + 1, 1,
this.acceptsNav, this);
}
} else if (k == e.TAB) {
e.stopEvent();
ed.completeEdit();
if (this.moveEditorOnEnter !== false) {
if (shift) {
newCell = g.walkCells(ed.row - 1, ed.col, -1,
this.acceptsNav, this);
} else {
// alert('go');
newCell = g.walkCells(ed.row + 1, ed.col, 1,
this.acceptsNav, this);
}
}
} else if (k == e.ESC) {
ed.cancelEdit();
}
if (newCell) {
g.startEditing(newCell[0], newCell[1]);
}
}
});
var sm2 = new Ext.grid.RowSelectionModel({
moveEditorOnEnter : true,
singleSelect : true,
listeners : {
rowselect : function(sm, row, rec) {
centerForm.getForm().loadRecord(rec);
}
}
});
- Extjs Grid 回车换行事件
- Extjs 4.2 grid 行选择绑定回车事件
- Extjs Grid自动换行
- Extjs grid表头换行
- 编辑grid 回车实现换行
- Extjs 文本框 回车事件
- ExtJs监听回车事件
- extjs grid 编辑事件
- ExtJS grid全选事件
- ExtJs textfield侦听回车事件
- Extjs grid 及触发事件
- angular 回车事件(回车发送,回车加ctrl 换行)
- 获取键盘回车事件,并阻止回车换行事件
- ALV GRID 响应回车事件修改内容
- ALV GRID 响应回车事件修改内容
- ExtJs Grid topbar的search回车发送请求
- extjs表单输入框响应回车事件
- extjs表单输入框响应回车事件
- windows Nginx 安装及配置
- Java高手是如何练成的
- eclipse导出jar
- IE8和IE7的兼容问题
- ASP.NET WEB开发规范_控件命名规范
- Extjs Grid 回车换行事件
- wince驱动开发四
- java 读写文件
- Flex调用Webservice实现天气预报
- Android 的隐私保护
- 较好的编程状态
- asp.net 在客户端导出excel文档
- CSDN开博,致力于非常邪门的开发
- 创新工场和中国田径同病相怜