2016-09-08 82 views
2

是否有一個屬性或方法可以指定ShieldUI網格中列的最小寬度?ShieldUI網格列最小寬度

$("#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 
        ] 
       } 
       ] 
      }); 

回答

2

是的,有一個minWidth property,像這樣描述:

其中,當用戶調整它的列可以採取的最小寬度。在 爲了使用此屬性,需要將網格的大小調整爲 。