bulkjs
base for a manager for multiple selection.
Example
var bulkAction = bulk(scope, {
toId: function(x) {
return x.uuid;
},
update: function(scope, event, eventName) {
var selected = scope.bulkAction.list();
if (!scope.bulkAction.all()) {
all[0].checked = '';
} else {
all[0].checked = 'checked';
}
scope.collection.map(function(o, k) {
var checked = selected.indexOf(o.uuid) > -1;
o.content.checked = checked ? 'checked' : '';
});
if (scope.bulkAction.all()) {
sl.html("all");
} else {
if (selected.length > 0) {
sl.html(selected.join(","));
} else {
sl.html("none");
}
}
}
});