Permalink
Browse files

feat(project): handle custom actions

  • Loading branch information...
jeremyvergnas committed Jun 27, 2016
1 parent 340a5ec commit 630fad9683aa663eb93e24bd5495316b600a76b8
Showing with 9 additions and 4 deletions.
  1. +4 −0 src/bootstrap/datatable.html
  2. +5 −4 src/datatable.js
@@ -63,6 +63,10 @@
<button if.bind="destroy !== null" class="btn btn-sm btn-danger" click.delegate="doDestroy(row)">
<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)">
<i class="fa fa-${action.icon}"></i>
</button>
</td>
</tr>
</tbody>
@@ -28,6 +28,7 @@ export class DataTable {
@bindable data;
@bindable route;
@bindable pages;
bindable actions;
constructor(Router, element, entityManager) {
this.router = Router;
@@ -115,8 +116,8 @@ export class DataTable {
searchColumnChanged(newValue, oldValue) {
if (!this.ready) {
return;
}
}
delete this.criteria.where[oldValue];
return this.doSearch();
@@ -125,8 +126,8 @@ export class DataTable {
doSearch() {
if (!this.ready) {
return;
}
}
if (typeof this.criteria.where[this.searchColumn] === 'object') {
this.criteria.where[this.searchColumn].contains = this.search;
} else {

0 comments on commit 630fad9

Please sign in to comment.