Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • 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
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(