ratiw / vue-table

data table simplify! -- vuetable is a Vue.js component that will automatically request (JSON) data from the server and display them nicely in html table with swappable/extensible pagination component.
MIT License
1.83k stars 303 forks source link

loading fields via ajax #159

Closed adamhowse closed 7 years ago

adamhowse commented 7 years ago

Is there a way to load the fields array required by vue-table through an ajax request? I am trying to do this however run into problems as the ajax response finishes after vuetable has loaded.

I am currently trying todo this on the created method

    created () {
        let that = this

        axios.get(this.url).then(function (response) {
            that.fields = response.data.columns
            that.$refs.vuetable.reload()
        })
    },`

thanks for your help.

adamhowse commented 7 years ago

Closing as raised in vuetable 1 instead of 2. Sorry!