-
Notifications
You must be signed in to change notification settings - Fork 301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stop action events ? #51
Comments
@malaschitz I actually overlook this issue. This will be fixed in the next release. Probably through a new event The work around at the moment is to add a CSS class (e.g. To demonstrate the work-around using this example var tableColumns = [
{
name: 'id',
title: '',
dataClass: 'detail-toggle center aligned', // <--- add "detail-toggle" class
callback: 'showDetailRow'
},
//... new Vue({
el: '#app',
//...
methods: {
//...
// add "detail-toggle" class to the icon as well
showDetailRow: function(value) {
var icon = this.$refs.vuetable.isVisibleDetailRow(value) ? 'down' : 'right'
return [
'<a class="show-detail-row">',
'<i class="detail-toggle chevron circle ' + icon + ' icon"></i>',
'</a>'
].join('')
},
//...
},
events: {
//..
'vuetable:row-clicked': function(data, event) {
// filter the clicked target to see if it contains 'detail-toggle' class
if (event.target.classList.contains('detail-toggle')) {
this.$broadcast('vuetable:toggle-detail', data.id)
}
},
//...
}
}) In this example, the detail row will only gets toggled when the user clicks on the |
I suggest do not create a new event, but do not broadcast vuetable:row-clicked when is broadcast vuetable:action. Because I could broadcast event vuetable:row-clicked in my action when I will need it (but it is probably common). Thanks for work around. |
I don't think that is possible. They are two separate events and are emitting independently from different DOM element. Based on my initial test, a new event would solve this quite easily but I don't have time to look at it in more detail. It seems redundant, but I think each event would have its use when appropriate. The good thing about the event model is that it is optional. You only register for the event(s) you're interested in and ignore everything else. The bad thing is you have to be more careful about the side effect. |
this is to fix the side effect of row-clicked event to toggle-detail event (#51) and also provide more fine grain click detection to table column.
this is to fix the side effect of row-clicked event to toggle-detail event (#51) and also provide more fine grain click detection to table column.
I have vue-table with item-actions and with detail-row too.
When I click on button (item-action) both events are called. At first item-action and next is open detail-row. Is possible stop detail-row event ?
The text was updated successfully, but these errors were encountered: