ngx-datatable: Sorting not working on using 'Template', 'Flex', on using flex for column, resizing is an issue

I’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

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: 7.3.0
  • Angular version: 4.0.2
  • 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]

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 17 (2 by maintainers)

Most upvoted comments

Make sure you put let-sort="sortFn" in your ng-template and make sure to encapsulate your content in a class with a span <span (click)="sort()">Your Content here </span>

This was the case for me. Here’s a full code example of my column template:

<ngx-datatable-column name="Description"> <ng-template let-column="column" let-sort="sortFn" ngx-datatable-header-template> <span (click)="sort()">Your Content Here</i></span>Beschrijving </ng-template> </ngx-datatable-column>

Any updates on the sorting for a custom Template? I found if I add a font-awesome icon as the content to a sort-btn class it will work, but I don’t want a sort for all tables. Adding sortable:false does not change this.

Thanks, solved sorting issue by removing ngx-datatable-header template, i was using multiple column templates. performance also got enhanced on doing so.