|
本帖最后由 erp8@live.cn 于 2014-4-5 23:00 编辑
<x:RenderField ColumnID="Name" DataField="Name" FieldType="String" HeaderText="名称">
<Editor>
<x:TextBox ID="TextBox1" Required="true" runat="server">
</x:TextBox>
</Editor>
</x:RenderField>
---以上为单元格定义!
可编辑表格回车换单元格(回车后横向移动到下一单元格,现在回车后在原地不动)
<script type="text/javascript">
var gridClientID = '<%= Grid1.ClientID %>';
function registerEnterEvent() {
var grid = X(gridClientID);
/*
if (grid.el.getAttribute('data-event-keydown-registered')) {
return;
}
grid.el.set({ 'data-event-keydown-registered': true });
*/
grid.el.on("keydown", function (evt, el) {
if (evt.getKey() == evt.ENTER) {
var nextRow = Ext.get(el).parent('.x-grid3-row').next();
if (nextRow) {
nextRow.query('.x-grid-tpl input')[0].select();
}
}
}, { delegate: '.x-grid-tpl input' });
}
function onReady() {
var grid = X(gridClientID);
grid.on('viewready', function () {
registerEnterEvent();
});
}
</script>
-----用这个方法不行啊?
高手指点?
|
|