在我使用内联单元格编辑的 JQgrid 中,当我在 generate 中从一个 dateCell 切换到另一个时Uncaught Type error
。
错误如下:
Uncaught TypeError: Cannot read property 'dpDiv' of undefined jquery-ui-1.8.19.custom.min.js:65
我认为出错的是 datepicker 字段中的 keydown 事件被触发,并且当它执行时发现它dpDiv
为空。为了克服这个问题,我试图在Tab
按下键时破坏 keydown 事件,但这里没有运气..
这就是我正在做的事情,它会产生这个错误:
afterEditCell: function (id, name, val, iRow, iCol) {
var cModel = $grid.jqGrid("getGridParam", "colModel");
var currCol = cModel[iCol].name;
var $row = $grid.find('.jqgrow#' + id);
var $columns = $row.find('td');
$td = $($columns[iCol]);
if (isAnyDate(iCol)) {
$td.find('input').addClass('textBoxStyle').datepicker().keyup(function (e) {
var code = e.which || e.keyCode;
if (code == 9)
$(this).datepicker('destroy');
});
}
});
当鼠标单击用于单元格导航时,它工作正常!
帮助任何人?