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.

Unable to add a row if sorting is set

See original GitHub issue

I’m submitting a … (check one with “x”) bug report

Current behavior Add doesn’t work if sorting is enabled

Expected behavior Add works fine even if sorting is enabled

Reproduction of the problem

  1. Open Basic/Live Data page demo in a browser
  2. Set sorting on any column
  3. Click Add button at the top

What is the motivation / use case for changing the behavior? Adding rows while sorting is set? 😃

Please tell us about your environment: Windows 8.1 x64 Node 7.7.3

  • Table version: 0.8.x The latest from the repo

  • Angular version: 2.0.x The latest from the repo

  • 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 ] Chrome 58.0.3029.81

  • Language: [all | TypeScript X.X | ES6/7 | ES5] all

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:3
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
akkaradejcommented, May 29, 2017

sortRows() returns the copy of rows. https://github.com/swimlane/ngx-datatable/blob/9.2.0/src/utils/sort.ts#L67

If we enable client-side sorting, this copy will be assigned to ngx-datatable’s rows. https://github.com/swimlane/ngx-datatable/blob/9.2.0/src/components/datatable.component.ts#L107

So, our rows array has different reference from ngx-datatable’s rows at the beginning.

My work around is re-assigning rows after modified.

this.rows.push({});
this.rows = [...this.rows];
3reactions
JosephAntonioucommented, Apr 25, 2017

This is the case also with remove.

Read more comments on GitHub >

github_iconTop Results From Across the Web

excel won't sort the first row in a set of selected rows
Hi, I'd like to sort some data in an excel spreadsheet alphabetically, according to the content of the second column.
Read more >
How to Sort in Excel Rows or Columns Avoid Sort Problems
If you are sorting on multiple columns, click the Add Level button, to add the next level, and select options from its drop...
Read more >
Unable to Add Row in Excel - Super User
I assume you have selected the columns only when you defined your table, so the table already cover all of the lot-lot available...
Read more >
Adding new data in excel and cannot be sorted or filtered
Another solution which may not be as obvious is to Un-click the filter button under the data tab and then re-click filter.
Read more >
Excel Can't Insert New Cells Because it Would Push Non ...
This error is often caused because there is something in the last row or column of the worksheet. This video demonstrates how to...
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