Holiday Notice: Support will be provided on a limited scale from December 24th, 2024, to January 2nd, 2025. Happy holidays and a wonderful New Year!


Topic: Link in Datatable Column

falkonde free asked 5 years ago


In my datatable I have a link in one of the columns and I would like this target link to be loaded in the router-view and not load the entire application again. Or in other words if the link could be a router link and not a standard link. Is this possible?

rows: [
          {
            name: 'Tiger Nixon',
            categories: 'Lorem',
            date: '2010/04/25',
            link: '<a href="/my_url_in_app" >Text link</a>'
          },

that will work as if the code were like this:

rows: [
          {
            name: 'Tiger Nixon',
            categories: 'Lorem',
            date: '2010/04/25',
            link: '<router-link to="/my_url_in_app" >Text link </router-link>'
          },

....


Magdalena Dembna staff answered 5 years ago


Content from link is rendered via v-html which accepts only raw html and that's why this approach won't work. Unfortunately I don't see any solution which would make it work for datatable component. More complicated structure and nesting components within cells would require building your own table from scratch - our goal was to enable using simple html content such as links and images. Kind regards, Magdalena



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Vue
  • MDB Version: 5.6.0
  • Device: PC
  • Browser: Chrome
  • OS: Windows
  • Provided sample code: No
  • Provided link: No