Permalink
Browse files

fix(customActions): handle disabled attribute

  • Loading branch information...
jeremyvergnas committed Jun 28, 2016
1 parent 630fad9 commit a033650a6b5846e755da09551618cca454d97c9a
Showing with 7 additions and 1 deletion.
  1. +1 −1 src/bootstrap/datatable.html
  2. +6 −0 src/datatable.js
@@ -64,7 +64,7 @@
<i class="fa fa-trash"></i>
</button>
<button repeat.for="action of actions" class="btn btn-sm btn-${action.type || 'white'}" click.delegate="action.action(row)">
<button repeat.for="action of actions" disabled.bind="action.disabled" class="btn btn-sm btn-${action.type || 'white'}" click.delegate="doCustomAction(action, row)">
<i class="fa fa-${action.icon}"></i>
</button>
</td>
@@ -99,6 +99,12 @@ export class DataTable {
}
}
doCustomAction(action, row) {
if (typeof action.action === 'function' && !action.disabled) {
return action.action(row);
}
}
doSort(columnLabel) {
if (this.sortable === null || columnLabel.column.indexOf('.') !== -1) {
return;

0 comments on commit a033650

Please sign in to comment.