Get 2024 Templates Mega Bundle!$1000 worth of 19 Bootstrap HTML, Vue & React Templates + 3 Vector Sets for just $99
Get for 99$

onClick event not working in tbody childs


I tried onclick for tbody element like td,tr but not triggering any event.


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 (4)

Deleted comment

Hi,

Thank you for reaching out to us.

You can find the basic sorting functionality using an example in our Datatable document,
https://keenthemes.com/metronic/tailwind/docs/components/datatable#static

Regards,
Lauris Stepanovs,
Keenthemes Support Team



Thanks for answer. I need to this event for icons in tbody childs like tr. I am using react and I need to select row and fetch some data on click icon.



Hi,

I want to apologize for the late reply.

Have you tried using the sort event of KTDataTable?

const datatable = new KTDataTable(datatableEl, options);

datatable.on("sort", () => {
console.log("sort data");
});


Regards,
Lauris Stepanovs,
Keenthemes Support Team



I am using Metronic Tailwind Datatables like this
<div
data-datatable="true"
data-datatable-page-size="10"
data-datatable-state-save="true"
>
<div className="scrollable-x-auto">
<table
className="table table-border table-fixed"
data-datatable-table="true"
>


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  :(