angular - ngx-datatable - Bootstrap 主题 - 列标题

标签 angular bootstrap-4 angular-components ngx-datatable

我正在尝试通过实现 Bootstrap 主题来实现 ngx-datatable。

我正在从 Bootstrap 4 和应用样式的 ngx-datatable 添加 Bootstrap CSS:

"styles": [
          "node_modules/bootstrap/dist/css/bootstrap.css",
          "node_modules/@swimlane/ngx-datatable/release/themes/bootstrap.css",
          "src/styles.css"
        ],

然后在我的页面组件上实现表格:

<ngx-datatable class="bootstrap"
[rows]="tablePage.results"
[columns]="columns"
[columnMode]="'force'"
[rowHeight]="'auto'"
[headerHeight]="50"
[footerHeight]="50"
[externalPaging]="true"
[loadingIndicator]="loading"
[count]="tablePage.pager.count"
[offset]="tablePage.pager.offset"
[limit]="tablePage.pager.limit"
[reorderable]="true"
(page)='setPage($event)'>

另外,模块全部导入到app模块中:

imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
NgbModule,
FontAwesomeModule,
NgxDatatableModule
],

问题在于没有显示列标题图标。没有显示任何排序方向图标,我不知道还要添加什么,因为一切看起来都像在演示站点中一样设置。

最佳答案

不要忘记包含 node_modules/swimlane/ngx-datatable/release/assets/icons.css

或者对于 sass @import '~@swimlane/ngx-datatable/release/assets/icons.css';

关于angular - ngx-datatable - Bootstrap 主题 - 列标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54190428/

相关文章:

angular - 无法保护 Azure 静态 Web 应用预览中的路由

angular - 单元测试 Angular 2 服务主题

angular - 如何修复 Argument of type '"email "' is not assignable to parameter of type ' string[]' 错误?

javascript - Angular 2中的背景图片

html - 如何在 Angular 7 中加载页面后触发引导模式弹出窗口

javascript - knockout 选择数据绑定(bind)

angular - 如何使用参数实例化 Angular 组件?

Angular 2 : Wrapping a component inside a parent component

javascript - 从 AJAX 创建时卡住 Bootstrap

javascript - Angular - 如何从另一个组件切换组件中元素的可见性?