Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/421.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 编辑时剑道UI网格打断高度设置(Jquery)_Javascript_Jquery_Kendo Ui_Kendo Grid - Fatal编程技术网

Javascript 编辑时剑道UI网格打断高度设置(Jquery)

Javascript 编辑时剑道UI网格打断高度设置(Jquery),javascript,jquery,kendo-ui,kendo-grid,Javascript,Jquery,Kendo Ui,Kendo Grid,问题 我有一个剑道UI JQuery网格。所有的功能都像我期望的那样工作,但是我在添加新记录时遇到了一个错误 可以添加和保存记录,但网格的页脚会“浮动”到网格的一半,而滚动条会被删除,使其看起来已损坏 经过进一步调查,我认为滚动条实际上是关于初始高度设置的,但在编辑时,滚动条似乎消失了,网格是全高的 调查 我在创建新记录时没有自定义处理程序 我有一个习惯 然而,在上述场景中,数据绑定事件是传递的 不接触网格 这似乎不是一个CSS问题,因为在开发人员工具中检查DOM没有任何值得注意的地方 我现在也

问题

我有一个剑道UI JQuery网格。所有的功能都像我期望的那样工作,但是我在添加新记录时遇到了一个错误

可以添加和保存记录,但网格的页脚会“浮动”到网格的一半,而滚动条会被删除,使其看起来已损坏

经过进一步调查,我认为滚动条实际上是关于初始高度设置的,但在编辑时,滚动条似乎消失了,网格是全高的

调查

  • 我在创建新记录时没有自定义处理程序
  • 我有一个习惯 然而,在上述场景中,数据绑定事件是传递的 不接触网格
  • 这似乎不是一个CSS问题,因为在开发人员工具中检查DOM没有任何值得注意的地方
  • 我现在也尝试添加我自己的自定义添加(第一点我保留了标准)。其激发和行为与预期一致,但仍存在滚动条消失和页脚“浮动”的问题
  • 控制台中没有错误消息等。。。继续
  • 代码:

    网格定义为:

    $("#timeItemsGrid").kendoGrid({
                //scrollable: false,
                sortable: true,
                filterable: true,
                editable: true,
                resizable: true,
                pageable: false,
                height: 750,
                groupable: { sort: { dir: "desc" } },
                toolbar: ["create", "save"],
                dataBound: onDataBound,
    
                dataSource: {
                    data: itemsToUse,
    
                    schema: {
                        model: {
                            fields: {
                                copiedTime: { type: "boolean" },
                                customerObj: { defaultValue: { customerText: null, customerId: null } },
                                mainCustName: { type: "string" },
                                item: { type: "string" },
                                itemText: { type: "string" },
                                casetaskevent: { defaultValue: { casetaskevent: null, casetaskeventText: "" } },
                                team: { type: "string" },
                                teamText: { type: "string" },
                                div: { type: "string" },
                                divText: { type: "string" },
                                loc: { type: "string" },
                                locationText: { type: "string" },
                                isbillable: { type: "boolean" },
                                mon: { defaultValue: { timeSheetId: 0, hours: 0, memo: "" } },
                                tue: { defaultValue: { timeSheetId: 0, hours: 0, memo: "" } },
                                wed: { defaultValue: { timeSheetId: 0, hours: 0, memo: "" } },
                                thu: { defaultValue: { timeSheetId: 0, hours: 0, memo: "" } },
                                fri: { defaultValue: { timeSheetId: 0, hours: 0, memo: "" } },
                                sat: { defaultValue: { timeSheetId: 0, hours: 0, memo: "" } },
                                sun: { defaultValue: { timeSheetId: 0, hours: 0, memo: "" } }
                            }
                        }
                    },
                    aggregate: [
                        { field: "mon.hours", aggregate: "sum" },
                        { field: "tue.hours", aggregate: "sum" },
                        { field: "wed.hours", aggregate: "sum" },
                        { field: "thu.hours", aggregate: "sum" },
                        { field: "fri.hours", aggregate: "sum" },
                        { field: "sat.hours", aggregate: "sum" },
                        { field: "sun.hours", aggregate: "sum" }
                    ]
                }, 
    
    以及数据绑定方法

    function onDataBound(e) {
        console.log("onDataBound");
        var grid = $("#timeItemsGrid").data("kendoGrid");
        var data = grid.dataSource.data();
        var element;
    
        $.each(data, function (i, row) {
            if (row.dirty) {
                element = $("tr[data-uid=\"" + row.uid + "\"] ");
                $(element).removeClass("k-alt");
                $(element).addClass("isdirty");
            }
            if (row.copiedTime == true) {
                element = $("tr[data-uid=\"" + row.uid + "\"] ");
                $(element).removeClass("k-alt");
                $(element).addClass("copiedTime");
            }
        });
    
    }
    

    把我的头发拔了几个小时后

    捕捉网格的编辑功能并设置以下选项:

    var scrollable = document.querySelector("#timeItemsGrid > div.k-grid-content.k-auto-scrollable");            
    scrollable.style.overflow = "scroll";
    scrollable.style.overflowX = "hidden";
    
    
    var scrollable = document.querySelector("#timeItemsGrid > div.k-grid-content.k-auto-scrollable");            
    scrollable.style.overflow = "scroll";
    scrollable.style.overflowX = "hidden";