Bootstrap theme is not working
See original GitHub issueI’m submitting a … (check one with “x”)
[ ] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, post on Stackoverflow or Gitter
Current behavior
Expected behavior
Reproduction of the problem
What is the motivation / use case for changing the behavior?
Please tell us about your environment:
- Table version: 0.8.x
- Angular version: 2.0.x
- Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
- Language: [all | TypeScript X.X | ES6/7 | ES5]
I tried to add the bootstrap them on a component but it’s not working
As per the bootstrap component https://github.com/swimlane/ngx-datatable/blob/master/demo/basic/bootstrap.component.ts :
My component :
@Component({ selector: 'basic-bootstrap-theme-demo', template:
<div>
<ngx-datatable
class=“bootstrap”
[rows]=“rows”
[loadingIndicator]=“loadingIndicator”
[columns]=“columns”
[columnMode]=“‘force’”
[headerHeight]=“40”
[footerHeight]=“40”
[limit]=“10”
[rowHeight]=“‘auto’”
[reorderable]=“reorderable”>
</ngx-datatable>
</div>
`
})
export class BootstrapThemeComponent {
rows = []; loadingIndicator: boolean = true; reorderable: boolean = true;
columns = [ { prop: ‘name’ }, { name: ‘Gender’ }, { name: ‘Company’ } ];
constructor() { this.fetch((data) => { this.rows = data; setTimeout(() => { this.loadingIndicator = false; }, 1500); }); }
fetch(cb) {
const req = new XMLHttpRequest();
req.open(‘GET’, https://raw.githubusercontent.com/swimlane/ngx-datatable/master/assets/data/company.json
);
req.onload = () => {
cb(JSON.parse(req.response));
};
req.send();
}
}`
My component css :
@import '~@swimlane/ngx-datatable/release/index.css'; @import '~@swimlane/ngx-datatable/release/themes/bootstrap.css'; @import '~@swimlane/ngx-datatable/release/assets/icons.css';
I includes bootstrap 3.3.7 link in the index.html page
Here is the result It should look like :+1
Solution:
ADD themes in parent styles.css file but the folllowing problem occur ;
Issue Analytics
- State:
- Created 5 years ago
- Comments:12
Top GitHub Comments
Adding this to the styles.css file worked for me
@import "../node_modules/@swimlane/ngx-datatable/release/themes/bootstrap.css"
I’m still having issues with it, my table looks all white.
This is my angular.json
Guys can you please also update the docs ?