-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfootable.js
More file actions
31 lines (26 loc) · 772 Bytes
/
footable.js
File metadata and controls
31 lines (26 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Template.footable.rendered = function () {
var self = this;
var dataAttributes = Object.getOwnPropertyNames(Template.currentData());
var table = self.find('.footable');
$.each(dataAttributes, function(index, value) {
$(table).attr(value, Template.currentData()[value]);
});
$(table).footable();
};
Template.fooBody.rendered = function () {
//console.log('Redrawing Footables');
//$('.footable').trigger('footable_redraw');
};
Template.fooBody.helpers({
mapped: function (arr) {
var mappedArray = arr.map(function (item, index) {
item.$last = index === arr.length-1;
return item;
});
return mappedArray || [];
},
redrawFootable: function () {
console.log('Redrawing Footables via Helper');
$('.footable').trigger('footable_redraw');
}
});