屏蔽UI网格隐藏列破坏单元格对齐

Shield UI Grid Hidden Columns ruins Cell alignments

本文关键字:单元格 对齐 UI 网格 隐藏 屏蔽      更新时间:2023-09-26

我有一个带隐藏列的屏蔽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");
});

Shield UI开发人员正在修复这个错误,很快就会有修复程序。