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.

sortable: false is being ignored

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

sortable: false in column definitions is being ignored.

Expected behavior

Columns defined with sortable: false should not be sortable.

Reproduction of the problem

With remote sorting enabled, if you define your columns and assign them sortable: false they are still sortable.

What is the motivation / use case for changing the behavior?

So you can make your columns unsortable.

Please tell us about your environment:

  • Table version: 9.0.0
  • Angular version: 4.0.0
  • Browser: [all]
  • Language: [all]

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:7
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
ychaikincommented, Jun 16, 2017

@lobo-tuerto, curious, are you using ngx-datatable-column in your template? And if so, are you explicitly passing in [sortable]="columnObj.sortable" or something like that?

I got burned on that because I thought that if you pass columns into the ngx-datatable itself with a particular column having sortable be false, it would pick it up. However, apparently, if you specify a custom ngx-datatable-column, you have to pass that input into that explicitly. Once you do, it does what you would expect.

Perhaps, @amcdnl can correct me on that if I am wrong.

1reaction
FrancescoBorzicommented, May 31, 2018

the following works for me:

<ngx-datatable-column [sortable]="false" prop="id" name="ID"></ngx-datatable-column>

using:

[externalPaging]="true"
[externalSorting]="true"

using version 11.2.0 with Angular 5

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable sorting on a column in a datatable
I tried adding this: data-sorter="false" to my <th> but it just ignored it. I also have tried this but it also just ignored...
Read more >
bSortable: false ignored when using fnDrawCallback
Hi Allan, I've noticed that when using fnDrawCallback in datatables I can sort columns that have the bSortable property set to false.
Read more >
Sorting Data Frames in Pandas: A Hands-On Guide | Built In
The columns above have been sorted in ascending alphabetical order. By setting ascending=False , we can sort in descending order also.
Read more >
Is there a way for Excel to ignore values in formula when ...
Because right now, I can only sort from smallest to highest to see at once the data I need, because for FALSE results,...
Read more >
sort-imports - ESLint - Pluggable JavaScript Linter
The import statement is used to import members (functions, objects or primitives) that have been exported from an external module.
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