Skip to content

Special Field

Rati Wannapanop edited this page Apr 15, 2016 · 11 revisions

Special Field

At the moment, vuetable only has one special field. It might have something more in the future, but special field will always begins with double underscore __.

  • __actions

    If you name one of your field as __actions, vuetable will automatically use the information provided via item-actions property to generate array of buttons inside this table column. And when the user click on any of these buttons, a vuetable:action event will be dispatched with the name of the action as the event argument along with the data row currently in process.

    You can capture this event in the parent Vue.js instance, and inspect the argument value to take any appropriate action based on that value.

    new Vue({
    	el: '#app',
    	methods: {
    		viewProfile: function(email) {
    			console.log('do something with email: ', email)
    		}
    	},
        events: {
            'vuetable:action': function(action, data) {
                console.log('vuetable:action', action, data)
                if (action == 'view-item') {
                    this.viewProfile(data.email)
                }
            },
    	}
    })
Clone this wiki locally