错误“验证器未定义”当使用jEditable编辑下拉列表时发生 [英] Error "validator is undefined" occured when edit drop down list using jEditable

查看:199
本文介绍了错误“验证器未定义”当使用jEditable编辑下拉列表时发生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用jeditable对我的表进行内联编辑。在我的表中,我可以编辑文本,日期戳和下拉列表。

I am using jeditable to do inline edit for my table. In my table i can edit text, datepicker and also dropdown.

但是,当我编辑下拉列表时,我会在firebug中收到错误:

However, when i edit the dropdown, i will get error in firebug:

validator is undefined
[Break On This Error] validator.settings[eventType] && v...ype].call(validator, this[0], event); 

错误发生在jquery.validate.js或jquery.js

Error is occured at either jquery.validate.js or jquery.js

但是,当我编辑我的下拉列表时,我没有调用任何验证方法。

However, I did not call any validate method when I edit my drop down list.

以下是声明jeditable下载的代码:

Following is the code to declare jeditable for dropdown:

  // Drop down
    $('.dropdown').editable('@(Url.Action("Edit", "Stock"))',
    {
        data: getFoodTypesList(),
        type: 'select',
        indicator: 'saving...',
        event: 'dblclick',
        //tooltip: 'Double click to edit...',
        style: 'inherit',
        width: '240px',
        submit: '<img src="@Url.Content("~/Content/Add_in_Images/ok.png")" alt="ok"/>',
        cancel: '<img src="@Url.Content("~/Content/Add_in_Images/cancel.png")" alt="cancel"/>',
        // Use callback function to assign display text for the field after edit
        callback: function (value, settings) {
            var temp = getFoodTypeName(value);
            $(this).text(temp);
            $.ajax({
                async: false,
                url: '@(Url.Action("GetStockTable", "Stock"))',
                type: 'GET',
                success: function (result) {
                    $('#tableplaceholder').html(result);
                    unitDropDown();
                }
            });
        }

    });

每次点击下拉菜单选择一个选项时,都会出错。任何想法是什么原因?或者有没有,我可以通过某种方式自动验证下拉菜单?

Error occur everytime i click on the dropdown to select an option. Any idea what is the cause? Or is there anyway I can "by pass" the somehow auto validation for the dropdown?

请帮助...非常感谢...

Please help... thank you very much...

编辑:

IE Developer Tool中显示的错误是不同的:

Error shown in IE Developer Tool is different:

 'settings' is null or not an object

而且指向这一行:

 // Datepicker
    $('.storagedatepicker').editable('/Stock/Edit',
    {
        type: 'datepicker',
        indicator: 'saving...',

哪个是datepicker字段的jeditable ...
我不明白为什么是相关的...

which is the jeditable for datepicker field... I cant see why is it related...

推荐答案

当我删除

@using BeginForm

从我的表...

我不记得为什么我包括,但到目前为止,它仍然工作正常没有它..我猜错误是由触发默认验证适用于表单标签中的任何内容。

I could not remember why am I including that but so far it still work fine without it.. I guess the error is triggered by the "default" validation apply to anything in the form tag..

任何意见和反馈仍然受到欢迎和赞赏..谢谢....

Any comments and feedbacks are still welcomed and appreciated.. Thanks....

这篇关于错误“验证器未定义”当使用jEditable编辑下拉列表时发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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