jQuery datepicker问题:未捕获的TypeError [英] jQuery datepicker issue: Uncaught TypeError

查看:107
本文介绍了jQuery datepicker问题:未捕获的TypeError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个jqgrid,我必须在单元格中提供标签导航。我遇到了一个奇怪的错误,到目前为止我无法理解。



我在网格中有多个日期单元,选中后,应该显示一个jquery默认的datepicker。我也碰巧将自己的textboxstyle类应用于所选的单元格。



这是我用来检测标签导航的代码:



I have a jqgrid, in which I have to provide tab navigation in the cells. I have encountered a strange error which I have failed to comprehend so far.

I have multiple date cells in the grid, which selected, should display a jquery default datepicker. I also happen to apply my own textboxstyle class to the cell which is selected.

This is the code that I am using to detect tab navigation:

afterEditCell: function (id, name, val, iRow, iCol) {
    var e = window.event;
    var charCode = e.which || e.keyCode;
    if (charCode == 9) {
        e.preventDefault();
        var $row = $grid.find('.jqgrow#' + id);
        var $columns = $row.find('td');
        $td = $($columns[iCol]);

        if (isAnyDate(iCol)) {
           $td.find('input').addClass('textBoxStyle').datepicker();  //if it is a date field then apply a datepicker
        }
        else {
            $td.find('input').addClass('textBoxStyle');
        }
   }





问题:我不断收到的错误是:





Problem: The error that I keep on getting is:

<pre lang="Javascript">Uncaught TypeError: Cannot read property 'dpDiv' of undefined jquery-ui-1.8.19.custom.min.js:65
$.extend._doKeyDown jquery-ui-1.8.19.custom.min.js:65
f.event.dispatch jquery-1.7.1.min.js:4
f.event.add.h.handle.i





奇怪的部分:当我使用鼠标浏览细胞时,并重复相同的程序,它就像一个魅力...那时没有错误..帮助?



The strange part: When I navigate through cells using mouse, and repeat the same procedure, it works like a charm...no error at that time..help?

推荐答案

row =


grid.find(' .jqgrow#' + id);
var
grid.find('.jqgrow#' + id); var


columns =
columns =


这篇关于jQuery datepicker问题:未捕获的TypeError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆