簡體   English   中英

未捕獲的TypeError:Kendo UI網格上的e(...)。parents(...)。andSelf

[英]Uncaught TypeError: e(…).parents(…).andSelf on Kendo UI Grid

每當我單擊添加新按鈕時,使用Kendo UI Grid都會出現問題,它總是會產生此腳本錯誤。 在此處輸入圖片說明

這是我正在使用的代碼:

dataSource = new kendo.data.DataSource({
    batch: true,
    pageSize: 20,
    transport: {
        read: {
            url: 'SaladEntry/GetSupport2/',
            dataType: "json"
        },
        destroy: {
            url: 'SaladEntry/DeleteSupportKendo2/',
            type: "POST",
            contentType: 'application/json'
        },
        create: {
            url: 'SaladEntry/SaveSupportKendo2/',
            type: "POST",
            contentType: 'application/json',
            complete: function (e) {
                SupportGrid();
            }
        },
        update: {
            url: 'SaladEntry/EditSupportKendo2/',
            type: "POST",
            contentType: 'application/json',
            complete: function (e) {
                SupportGrid();
            }
        },
        parameterMap: function (options, operation) {
            if (operation == "read") {
                return saladparamObj;
            }
            else {
                options.models[0].CountryNo = $('#Country_No').val();
                var SaladParamSerialized = JSON.stringify(options.models);

                return SaladParamSerialized;
            } 
        }
    },
    schema: {
        model: {
            id: "PK",
            fields: {
                CountryNo: { editable: true, nullable: true },
                EffectiveDate: { type: "date" },
                stringEffectiveDate: { type: "string" },
                ScaleMin: { validation: { required: true } },
                ScaleMax: { validation: { required: true } },
                Currency: { type: "string" }
            }
        }
    },

    sort: {
        field: "stringEffectiveDate",
        dir: "desc",
        compare: function (a, b, dir) {
            return kendo.parseDate(a.EffectiveDate) - kendo.parseDate(b.EffectiveDate);
        }
    }
});

$("#grid").kendoGrid({
    dataSource: dataSource,
    pageable: true,
    height: 300, 

    toolbar: ["create"],
    columns: [
    {
        field: "stringEffectiveDate", title: "Date",
        template: "#= kendo.toString(kendo.parseDate(EffectiveDate, 'yyyy-MM-dd'), 'yyyy-MM-dd') #", width: "100px",
        sortable: {
            allowUnsort: false,
            compare: function (a, b, dir) {
                return kendo.parseDate(a.EffectiveDate) - kendo.parseDate(b.EffectiveDate);
            }
        }
    },
    { field: "EffectiveDate", title: "Effective Date", template: "#= kendo.toString(kendo.parseDate(EffectiveDate, 'yyyy-MM-dd'), 'yyyy-MM-dd') #", width: "100px" },
    { field: "ScaleMin", title: "BG1 Min", width: "100px" },
    { field: "ScaleMax", title: "BG7 Max", width: "100px" },
    { field: "Currency", title: "Currency", width: "100px" },
    { command: ["edit", "destroy"], title: "Commands", width: "160px" }



    ],
    height: 300,
    scrollable: true,
    sortable: true,
    filterable: true,
    pageable: true,
    resizable: true,
    selectable: true,
    editable: "popup",


    cancel: function (e) {

        nEdit();
    },
    edit: function(e) {
    e.container.find(".k-edit-label:first").hide();
    e.container.find(".k-edit-field:first").hide();
    if (!e.model.isNew()) {
        var dt = e.container.find("input[name=EffectiveDate]").data("kendoDatePicker");
        dt.enable(false);
    }
    }
}).css("background-color", "#C7D6A7");

當我單擊“添加”或“編輯”按鈕時,沒有顯示彈出模式。 下面是我的視圖的屏幕截圖。 在此處輸入圖片說明

.andSelf在jQuery 3.0中已刪除。 您正在引用3.1.1。 您必須降級jQuery或找到Kendo的更新。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM