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: mdb-datatable-2 API rendering (lack of)

shineinterview free asked 4 years ago


Expected behavior

Call an external secure API and load data into an mdb-datatable-2 - we cannot put thew API URL inside the HTML mdb-datatable-2 as we need to pass authentication tokens.

Actual behavior

As such we call the API on the created method.

But this will not render the datatable.

If we use a std, mdb-tbl and a v-for="user in users" scenario all is good.

However we've obtained the full features of mdb so want to use this method of loading data, then sorting and paging etc.

Resources (screenshots, code snippets etc.)

Please advise a solution:

  <mdb-datatable-2
:data="users"
striped
bordered

/>

created () { this.getUsers() },

getUsers () {
  userService.getAllUsers(this.authData.access_token).then((response) => {
    this.users = response.data
  })
},

Magdalena Dembna staff commented 4 years ago

Have tried following this example from our docs? https://mdbootstrap.com/docs/vue/tables/datatables/#external-api

Best 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

Opened

Specification of the issue

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