Datatable does not dynamically update information

Hello,

I'm using the "Datatable" component and when I update it to the "table-data" prop the "Datatable" component doesn't render the new data (it doesn't change dynamically).

Do you know how to solve it?

Thanks,
MB

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

Hi Mateus Bonadiman,

Could you please clarify the issue? Where do you change the "table-data" value?
Please let us know which app are you working on. Laravel or HTML version?

Thanks

Hi Faizal,

The value was changed through a computed which is passed to the prop table-data. The computed updates but the datatable does not update.

I'm using VUE.

Regards,
MB

Hi Mateus,

Could you please specify which Metronic version are you using?

In the Metronic v8.1.1, we made some refactoring of our datatable component and the issue should be fixed in this version.

Regards,
Lauris Stepanovs,
Keenthemes Support Team

Hi Lauris,

I updated and now works.

The only thing that still doesn't work correctly is when we have a dropdown button (actions) in the table.

The operation of the drop down button in the table is arbitrary, that is, sometimes you click on it and it shows the options and sometimes nothing happens.

When it works, for example, and I press F5, it reloads the table, but when I click the button again, nothing happens.

Please check if there is a bug in the component.

Thanks,
MB

Hi,

The MenuComponent reinitializes for each page separately during the page load, most likely your data is fetched and rendered asynchronously so you need to recall the MenuComponent initialization function again.

MenuComponent.reinitialization();

Regards,
Lauris Stepanovs,
Keenthemes Support Team

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