Skip to content
This repository was archived by the owner on Nov 27, 2018. It is now read-only.

Commit 49ada5f

Browse files
committed
Update to 1.1.0: Remove any trace of HTML ids from the package to allow multiple datatables on one page
1 parent c0110d6 commit 49ada5f

File tree

4 files changed

+9
-5
lines changed

4 files changed

+9
-5
lines changed

.versions

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ [email protected]
33
44
55
6-
ephemer:reactive-datatables@1.0.8
6+
ephemer:reactive-datatables@1.1.0
77
88
99

package.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package.describe({
22
name: 'ephemer:reactive-datatables',
33
summary: "Fast and reactive jQuery DataTables using standard Cursors / DataTables API. Supports Bootstrap 3.",
4-
version: "1.0.8",
4+
version: "1.1.0",
55
git: "https://github.com/ephemer/meteor-reactive-datatables.git"
66
});
77

reactive-datatable-template.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<template name="ReactiveDatatable">
2-
<div id="datatable_wrapper"></div>
2+
<div class="datatable_wrapper"></div>
33
</template>

reactive-datatable-template.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
Template.ReactiveDatatable.rendered = function() {
22
var data = this.data;
3+
4+
if (typeof data.tableData !== "function") {
5+
throw new Meteor.Error('Your tableData must be a function that returns an array via Cursor.fetch(), .map() or another (hopefully reactive) means')
6+
}
7+
38
var reactiveDataTable = new ReactiveDatatable(data.options);
49

510
// Help Blaze cleanly remove entire datatable when changing template / route by
611
// wrapping table in existing element (#datatable_wrap) defined in the template.
712
var table = document.createElement('table');
8-
table.id = 'datatable';
913
table.className = 'table dataTable';
1014

1115
// Render the table element and turn it into a DataTable
12-
$(this.find('#datatable_wrapper')).append(table);
16+
this.$('.datatable_wrapper').append(table);
1317
var dt = $(table).DataTable(data.options);
1418
reactiveDataTable.datatable = dt;
1519

0 commit comments

Comments
 (0)