在dojo.gridX中添加新行时如何聚焦第二个Cell
How to focus second Cell when add a new row in dojo.gridX
我使用dojo.gridx
来显示我的值。有时用户可以创建一个新行。因此,我已经添加了一个新的按钮,当点击newRow按钮,将调用onclick方法。
在该方法中创建了新的行代码。我的代码如下:
addRow:
function() {
var that = this;
var gridIdLocal = dijit.byId('GridId');
that.lastIndex+=1; ( last index count I get externally)
var newRow = {
Id : '',
ClassDES:'',
createdDate: that.getTodayDate(),
activatedDate:that.getTodayDate(),
deactivedDate:'',
activeStatus:'Y',
id : lastIndex
};
gridIdLocal.store.newItem(newRow);
gridIdLocal.store.save();
},
通过这段代码,我能够创建一个新的行,但我想把鼠标光标指向新添加的行的第二列(ClassDES)。
如何在dojo.gridx
中实现此功能?
我没有使用过Dojo gridx,但是看看它的一个基本演示,它在<div>
中为每一行呈现一个<table>
。使用上面示例中的newRow对象,您可以使用jquery
function() {
var that = this;
var gridIdLocal = dijit.byId('GridId');
that.lastIndex+=1; ( last index count I get externally)
var newRow = {
Id : '',
ClassDES:'',
createdDate: that.getTodayDate(),
activatedDate:that.getTodayDate(),
deactivedDate:'',
activeStatus:'Y',
id : lastIndex
};
gridIdLocal.store.newItem(newRow);
gridIdLocal.store.save();
$(newRow).find("td")[1].children("input").focus();
},
如果你能张贴一个工作的表格,这将更容易解决。
相关文章:
- 将事件聚焦/模糊在可编辑内容的元素上
- jQuery自动完成阻止选择后聚焦
- Google电子表格getValue([cell containing ])不返回制表符
- 使用向下箭头键(与tab键一样)聚焦下一个输入
- 当没有文本输入聚焦时检测空格键按下
- 如何移除或改进:在Bootstrap Carousel上聚焦风格
- 如何在悬停和聚焦时打开引导导航菜单
- 可以't滚动后聚焦输入
- 如何在angular bootstrap ui中聚焦活动导航选项卡中的拳头输入字段
- click-cell.bs.table是如何工作的
- 无法使用 $('input[name=“rate”]').focus() 聚焦文本框;方法
- 当在输入框中聚焦时,清除页面上的所有间隔
- notify.js没有'如果另一个窗口被聚焦,则不显示通知
- 不允许输入或聚焦的输入类型文本
- 在Chrome中聚焦
- 单击按钮时如何聚焦下一个文本字段
- onblur事件时,输入被强制聚焦
- jQuery - ScrollTo - 将菜单聚焦在所选目标上
- 多个选择框聚焦第一个选择框
- 在dojo.gridX中添加新行时如何聚焦第二个Cell