Shield UI网格隐藏列废墟细胞对齐

时间:2015-11-30 19:17:05

标签: javascript user-interface shieldui

我有一个带有隐藏列的shield-ui网格。一旦我修改了数据源,即执行过滤器或进行排序,我的列大小就搞砸了。

我的问题也可以在演示网站上看到

只需对网格排序没问题,然后隐藏一列并再次排序,您将看到问题

https://demos.shieldui.com/aspnet/grid-columns/columns-show-hide

jQuery(function($) {

    $("#grid").shieldGrid({
        dataSource: {
            data: gridJson
        },
        sorting: {
            multiple: true
        },
        paging: {
            pageSize: 5,
            pageLinksCount: 4
        },
        selection: {
            type: "row",
            multiple: false,
            toggle: true
        },           
        columns: [
            { field: "ServiceMarketingId", title: "ServiceMarketingId", width:"20%" },
            { field: "Code", title: "Code" , width:"20%"},
            { field: "Name", title: "Name", width:"20%" },
            { field: "MarketingName", title: "MarketingName", width:"20%" },
            { field: "Description", title: "Description" , width:"20%"}
        ],
        resizing: true

    });

    var dataSource = $("#grid").swidget().dataSource,
        timeout;

    $("#searchInput").on("keyup", function() {

        var val = $(this).val();
        console.log(val);
        clearTimeout(timeout);
        timeout = setTimeout(function() {
            dataSource.filter =  dataSource.filter = {
                or: [
                     { path: "Code", filter: "contains", value: val  },
                     { path: "Name", filter: "contains", value: val }
                ]
            }
            dataSource.read();
        }, 300);
    });

    $("#grid").swidget().hideColumn("ServiceMarketingId");

});

1 个答案:

答案 0 :(得分:1)

Shield UI开发人员正在努力修复此错误,并且很快就会提供修复。