我正在尝试通过实现 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/