ShieldUI网格列最小宽度

时间:2016-09-08 12:23:35

标签: jquery gridview grid shieldui

是否有属性或方法为ShieldUI Grid中的列指定最小宽度?

$("#grid1").shieldGrid({
                dataSource: {
                    data: products,
                    sort: [ { path: "['Category']['CategoryName']", desc: true } ],
                    filter: { field: "ProductID", value: "1" }
                },
                rowHover: false,
                columns: [
                "ProductName",
                { field: "['Category']['CategoryName']", title: "CategoryName", format: "{0:c}", width: "330px" },
                { field: "UnitPrice", title: "Unit Price", format: "{0:c}", width: "130px" },
                { field: "UnitsInStock", title: "Units In Stock", width: "130px" },
                { field: "Discontinued", width: "130px" },
                {
                    buttons: [
                            {
                                cls: "mybuttonCssClass",
                                caption: "<span class='glyphicon glyphicon-remove'></span> Delete",
                                commandName: "details", // build in - edit, delete
                                click: function (rowIndex) {
                                    var grid = this;
                                    // custom actions ...
                                    console.log(grid.options);
                                    alert(rowIndex);
                                }
                            },
                        { commandName: "delete" } // delete, edit, expand
                    ]
                }
                ]
            });

1 个答案:

答案 0 :(得分:2)

是的,有一个minWidth property,如下所示:

  

用户调整列时可以使用的最小宽度。在   为了使用此属性,需要调整网格的大小   上。