Merge pull request #3139 from tractorcow/pulls/3.1/fix-gridfield-sorting

BUG Fix grid field showing search without search component added
This commit is contained in:
Stig Lindqvist 2014-06-14 17:10:17 +12:00
commit 34304cf6e4

View File

@ -48,16 +48,19 @@
// multiple relationships via keyboard.
if(focusedElName) self.find(':input[name="' + focusedElName + '"]').focus();
var content;
if(ajaxOpts.data[0].filter=="show"){
content = '<span class="non-sortable"></span>';
self.addClass('show-filter').find('.filter-header').show();
}else{
content = '<button name="showFilter" class="ss-gridfield-button-filter trigger"></button>';
self.removeClass('show-filter').find('.filter-header').hide();
}
// Update filter
if(self.find('.filter-header').length) {
var content;
if(ajaxOpts.data[0].filter=="show") {
content = '<span class="non-sortable"></span>';
self.addClass('show-filter').find('.filter-header').show();
} else {
content = '<button name="showFilter" class="ss-gridfield-button-filter trigger"></button>';
self.removeClass('show-filter').find('.filter-header').hide();
}
self.find('.sortable-header th:last').html(content);
self.find('.sortable-header th:last').html(content);
}
form.removeClass('loading');
if(successCallback) successCallback.apply(this, arguments);