Skip to content
Permalink
Browse files

fix(actions): Prevent errors on undefined action

  • Loading branch information...
jeremyvergnas committed Dec 19, 2016
1 parent 9ce71a0 commit 5b3ff73567104ea9957afb0ec2824b695590e75b
Showing with 12 additions and 0 deletions.
  1. +12 −0 src/datatable.js
@@ -133,12 +133,20 @@ export class DataTable {
}

doCustomAction(action, row) {
if (!action) {
return false;
}

if (typeof action.action === 'function') {
return action.action(row);
}
}

checkDisabled(action, row) {
if (!action) {
return true;
}

if (typeof action.disabled === 'function') {
return action.disabled(row);
}
@@ -147,6 +155,10 @@ export class DataTable {
}

checkVisibility(action, row) {
if (!action) {
return false;
}

if (typeof action.visible !== 'function') {
this.hasVisibleActions = true;

0 comments on commit 5b3ff73

Please sign in to comment.
You can’t perform that action at this time.