|
楼主 |
发表于 2020-5-8 19:56:13
|
显示全部楼层
本帖最后由 hua_love2011 于 2020-5-8 20:02 编辑
请问在一个表格里面如何获取下一行当列的单元格,不然按照下面的方式实现得把人累死。表样如下图。大一点的报表能有近200个字段
Model.prototype.input5Keydown = function(event) {
this.moveInputFocus(event, "", "", "input1", "input6");
};
Model.prototype.input1Keydown = function(event) {
this.moveInputFocus(event, "input5", "", "input49", "input53");
};
Model.prototype.moveInputFocus = function(event, leftId, upId, rightId, nextId) {
var keyCode = event.keyCode;
if (keyCode == 37) { // 向左
$(this.getElementByXid(leftId)).focus();
} else if (keyCode == 38) {// 向上
$(this.getElementByXid(upId)).focus();
} else if (keyCode == 39) {// 向右
$(this.getElementByXid(rightId)).focus();
} else if (keyCode == 40) {// 向下
$(this.getElementByXid(nextId)).focus();
}
}
|
|