Skip to content

Commit

Permalink
Filter: Select2 update after filter row rebuilt. See #1237
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed Jun 29, 2016
1 parent de54b36 commit 6e81e5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/js/widgets/widget-filter-formatter-select2.min.js

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

5 changes: 4 additions & 1 deletion js/widgets/widget-filter-formatter-select2.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@

}, select2Def ),
arry, data,
c = $cell.closest('table')[0].config,
// add class to $cell since it may point to a removed DOM node
// after a "refreshWidgets"; see #1237
c = $cell.addClass('select2col' + indx).closest('table')[0].config,
wo = c.widgetOptions,
// Add a hidden input to hold the range values
$input = $('<input class="filter" type="hidden">')
Expand Down Expand Up @@ -118,6 +120,7 @@
// value = '/(^x$|^y$)/' => 'x,y'
var val = c.$table.data('lastSearch')[indx] || '';
val = val.replace(/^\/\(\^?/, '').replace(/\$\|\^/g, '|').replace(/\$?\)\/$/g, '').split('|');
$cell = c.$table.find('.select2col' + indx);
$cell.find('.select2').select2('val', val);
updateSelect2();
ts.filter.formatterUpdated($cell, indx);
Expand Down

0 comments on commit 6e81e5e

Please sign in to comment.