I want to display the smart table row data on another page. So whenever the user clicks on the row data its routes to the new page with this particular row data.
Please help on this, I am stuck
ThanksThis is mytable in advanced
I want to display the smart table row data on another page. So whenever the user clicks on the row data its routes to the new page with this particular row data.
Please help on this, I am stuck
ThanksThis is mytable in advanced
Copyright © 2021 Jogjafile Inc.
Looking at the ng2-smart-table documentation, it seems like there is a
userRowSelectevent that this table triggers when the user clicks a row. You can handle that and use theRouterto redirect to another page.You can pass the row data using the extras, something like this:
and you can access the passed data inside your component that handles the route by using the router again
but please be aware that the
router.getCurrentNavigationmethod only returns something if called in the constructor (or to be more precise: before the navigation has ended). If you need access to the state outside of the constructor, you can usehistory.stateinstead (but this adds another property to whatever data you pass, which is thenavigationId).