2

这是我的专栏定义

$scope.gridOpts = {
enableColumnResizing: true,
columnDefs : [
   {displayName:"Name",field:"name",width:'20%'},
   {displayName:"Gender",field:"gender",width:'*'},
   {displayName:"Company",field:"company",width:'60%'}
  ],
data: [
  { "name": "Ethel Price", "gender": "female", "company": "Enersol" },
  { "name": "Claudine Neal", "gender": "female", "company": "Sealoud" },
  { "name": "Beryl Rice", "gender": "female", "company": "Velity" },
  { "name": "Wilder Gonzales", "gender": "male", "company": "Geekko" }
]};

我想在最后一列(公司)上禁用调整大小,当前的解决方案工作正常,但是当窗口减小到某个点时开始截断并添加省略号。

4

1 回答 1

1

要禁用最后一列调整大小,请将 last column 属性设置enableColumnResizingfalse

columnDefs : [
       {displayName:"Name",field:"name",width:'20%'},
       {displayName:"Gender",field:"gender",width:'*'},       {displayName:"Company",field:"company",width:'60%',enableColumnResizing:false}
      ]

在调整大小时添加省略号是预期的行为。

如果要控制该行为,则必须将minWidth属性设置为列定义。

于 2017-03-21T08:12:36.170 回答