question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some characters in column name can break table

See original GitHub issue

I’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:open
  • Created 6 years ago
  • Reactions:4
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wizarrccommented, Oct 5, 2017

@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'});

0reactions
kallah94commented, Oct 4, 2021

I have the same issue twice but the prop trick work for me (ngx-datatable": “18.0.0”).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Splitting a single column (name) into two (forename, surname ...
One of the columns in a table from the old database is called 'name'. It contains a forename and a surname all in...
Read more >
column names and break in oracle sql script
I have table with two fields. EMP_ID varchar2(10) and EMP_NAME varchar(25). EMP_ID contains first 5 Characters Department Name like 'PDD', ...
Read more >
Split a column of text (Power Query) - Microsoft Support
Using the Query Editor, a column of text can be split into multiple columns, either by: delimiter, such as a comma or using...
Read more >
Escaping Column and Table and Names in MySQL (Part 2)
So you want a function to escape or validate user-input that is going to be inserted into a MySQL query as a column...
Read more >
How to write SQL queries with spaces in column names
In SQL Server, we can specify the column name with space in square bracket or parenthesis. Let us understand the concept with some...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found