New Metronic Docs!Added Integration Docs with Starter Kits Apps for Laravel, Laravel Livewire, Angular, Vue, Symfony, Blazor Server, Django & Flask & more
Browse Docs

KT Datatable Sorting Appears Broken


Hi there, I can't for the life of me figure out why I'm having so much trouble getting sorting to work in the KTUI datatables. I am pasting in the first example from official docs: https://ktui.io/docs/datatable, and the table displays but sorting does not work. I also noticed that on the official metronic demo pages, sorting does not work, see https://keenthemes.com/metronic/tailwind/demo2/account/security/allowed-ip-addresses for an example.

Using breakpoints I noticed that the click handler for the <th> components in the datatable does get added for sorting, but then are removed at some point later, rendering clicks useless.

Is this a known issue? I have tried a few workarounds but cannot make any progress on this. I am on the latest version of ktui (1.0.21).

Thanks


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


Hi Ted Goldstein

Could you please refer to the example of datatable with sorting: https://github.com/keenthemes/ktui/blob/main/examples/datatable/sorting-test.html

Thanks



Faizal, thank you for your response. I am indeed using the latest version of KTUI. I don't believe this is just an issue with Metronic.

Can you please give me some example code that you have verified results in sorting working with a ktui datatable on 1.0.21? I have to assume this is not broken for every person using them right now.



Hi Ted Goldstein

Sorry for the inconvenience. Thanks for the info. We will fix Datatable sorting issue for Metronic.

We did some improvements in the KTUI GitHub. You can pull the latest code if you are using git for KTUI.
https://github.com/keenthemes/ktui


Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(