Skip to content

Commit

Permalink
Add return value to JS datatableview.initialize()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tiliv committed Dec 18, 2013
1 parent 3bac13d commit 264772d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions datatableview/static/js/datatableview.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ var datatableview = {

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

var initialized_datatables = [];
$$.each(function(){
var datatable = $(this);
var column_options = [];
Expand Down Expand Up @@ -117,6 +118,7 @@ var datatableview = {
}

var initialized_datatable = datatable.dataTable(options);
initialized_datatables.push(initialized_datatable);

try {
initialized_datatable.fnSetFilteringDelay();
Expand All @@ -133,6 +135,7 @@ var datatableview = {
});
search_input.after(clear_button).after(' ');
});
return $(initialized_datatables);
}
}

Expand Down
2 changes: 1 addition & 1 deletion datatableview/static/js/datatableview.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 264772d

Please sign in to comment.