我正在尝试用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)'>
此外,所有模块都导入到应用程序模块中:
imports: [
BrowserModule,
AppRoutingModule,
HttpClientModule,
NgbModule,
FontAwesomeModule,
NgxDatatableModule
],问题是没有显示列标题图标。没有显示任何排序方向图标,我不知道还可以添加什么,因为一切似乎都像演示站点中的设置一样。
发布于 2019-03-14 23:00:12
别忘了包括node_modules/swimlane/ngx-datatable/release/assets/icons.css
或用于sass @import '~@swimlane/ngx-datatable/release/assets/icons.css';
https://stackoverflow.com/questions/54190428
复制相似问题