Skip to content

Commit 264772d

Browse files
committed
Add return value to JS datatableview.initialize()
This should facilitate the use of the function as a way to get references to the tables that were made without re-querying the DOM.
1 parent 3bac13d commit 264772d

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

datatableview/static/js/datatableview.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ var datatableview = {
5757

5858
var template_clear_button = $('<a href="#" class="clear-search">Clear</a>');
5959

60+
var initialized_datatables = [];
6061
$$.each(function(){
6162
var datatable = $(this);
6263
var column_options = [];
@@ -117,6 +118,7 @@ var datatableview = {
117118
}
118119

119120
var initialized_datatable = datatable.dataTable(options);
121+
initialized_datatables.push(initialized_datatable);
120122

121123
try {
122124
initialized_datatable.fnSetFilteringDelay();
@@ -133,6 +135,7 @@ var datatableview = {
133135
});
134136
search_input.after(clear_button).after(' ');
135137
});
138+
return $(initialized_datatables);
136139
}
137140
}
138141

datatableview/static/js/datatableview.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)