所以,我的 ui-grid 有这个列定义
columnDefs: [
{ name: 'Usr#', field: 'userNum', width: '*', resizable: true},
{ name: 'Name', field: 'userName', width: '*', resizable: true},
{ name: 'PID', field: 'userPID', width: '*', resizable: true},
{ name: 'Flags', field: 'userFlags', width: '*', resizable: true},
{ name: 'Blk Acc', field: 'dbAccess', width: '*', resizable: true},
{ name: 'OS Rd', field: 'osReads', width: '*', resizable: true},
{ name: 'OS Wr', field: 'osWrites', width: '*', resizable: true},
{ name: 'Hit%', field: 'hitRatio', width: '*', resizable: true},
{ name: 'Rec Lck', field: 'recLks', width: '*', resizable: true},
{ name: 'Rec Wts', field: 'recWts', width: '*', resizable: true},
{ name: 'Line#', field: 'lineNum', width: '*', resizable: true},
{ name: 'Program Name', field: 'procName', width: '*', resizable: true},
]
我有这个网格:
ui-grid 很友好,并试图为我格式化列标题 - 但我不希望它这样做;)
如何/如何关闭此选项?
另外,是否可以设置列以自动适应最大数据项的宽度?
最佳答案
不重新格式化 header 的解决方法是使用 displayName 字段: 例如:
columnDefs: [
...
{ name: 'PID', displayName: 'PID', field: 'userPID', width: '*', resizable: true},
...
关于angular-ui-grid - 如何关闭 ui-grid 列标题格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28652095/