Some characters in column name can break table
See original GitHub issueI’m submitting a … (check one with “x”)
[ 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 Column will not rendered if column has been created dynamically and name have underscore character “_”.
Expected behavior Column should rendered as usual.
Reproduction of the problem
<ngx-datatable class=“material qt-tests-list” [rows]=“csvRows” [columns]=“csvColumns” [columnMode]=“‘force’” [headerHeight]=“20” [footerHeight]=“20” [rowHeight]=“20” [loadingIndicator]=“loadingIndicator” [limit]=“10”> </ngx-datatable>
csvRows: any = []; csvColumns: any = []; … this.csvColumns.push({name: ‘test_1’},{name: ‘test2’}); this.csvRows.push({‘test_1’: ‘data1_1’, ‘test2’: ‘data1_2’}); this.csvRows.push({‘test_1’: ‘data2_1’, ‘test2’: ‘data2_2’});
First column will be empty
What is the motivation / use case for changing the behavior? This is a bug.
Please tell us about your environment: MacOS 10.12.6
-
Table version: 0.8.x This bug appears from early versions and still present (10.2.3)
-
Angular version: 2.0.x 4.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 ] Safari 11.0
-
Language: [all | TypeScript X.X | ES6/7 | ES5] TypeScript 2.4.2
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:9 (3 by maintainers)
Top GitHub Comments
@saewave bug confirmed!
http://plnkr.co/edit/1dNlbAG5YnIblwv8GHZa?p=preview
There is a workaround though. Try adding
prop: 'test_1'
in your example like so:this.csvColumns.push({name: 'test_1', prop: 'test_1'},{name: 'test2'});
I have the same issue twice but the prop trick work for me (ngx-datatable": “18.0.0”).