angular-ui-grid - 如何关闭 ui-grid 列标题格式

标签 angular-ui-grid

所以,我的 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},            
    ]

我有这个网格:

enter image description here

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/

相关文章:

javascript - Angular UI-grid 过滤器标题单元格样式?

javascript - UI 网格检查是否选择了任何行?

javascript - CellTemplate ui-grid 中的 ng-if

angular-ui-grid - ui-grid:virtualizationThreshold 如何工作?

javascript - 我可以在 ui-grid 中使用下拉菜单填充数据库中的数据吗?

angular-ui-grid - 如何重置(而不是恢复)网格状态?

javascript - ui-grid 的高度问题

javascript - 按需运行 AngularJS 指令

javascript - Angular ui-grid 保存来自不同范围对象的预填充值