mirror of https://gitee.com/y_project/RuoYi.git
修复冻结列排序样式无效问题
parent
dcbc77b403
commit
28c861c6df
|
@ -244,7 +244,32 @@
|
||||||
$('.fixed-table-body input[name=btSelectItem]').closest('tr').removeClass('selected');
|
$('.fixed-table-body input[name=btSelectItem]').closest('tr').removeClass('selected');
|
||||||
});
|
});
|
||||||
|
|
||||||
//// events
|
$("#" + table.options.id).off('click', '.fixed-table-body').on('click', '.th-inner', function (event) {
|
||||||
|
$.each(that.$fixedHeader.find('th'), function (i, th) {
|
||||||
|
$(th).find('.sortable').removeClass('desc asc').addClass('both');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
// events
|
||||||
|
this.$fixedHeader.off('click', '.th-inner').on('click', '.th-inner', function (event) {
|
||||||
|
var target = $(this);
|
||||||
|
var $this = event.type === "keypress" ? $(event.currentTarget) : $(event.currentTarget).parent(), $this_ = that.$header.find('th').eq($this.index());
|
||||||
|
|
||||||
|
var sortOrder = "";
|
||||||
|
if (table.options.sortName === $this.data('field')) {
|
||||||
|
sortOrder = table.options.sortOrder === 'asc' ? 'desc' : 'asc';
|
||||||
|
} else {
|
||||||
|
sortOrder = $this.data('order') === 'asc' ? 'desc' : 'asc';
|
||||||
|
}
|
||||||
|
table.options.sortOrder = sortOrder;
|
||||||
|
var sortName = $this.data('sortName') ? $this.data('sortName') : $this.data('field');
|
||||||
|
if (target.parent().data().sortable) {
|
||||||
|
$.each(that.$fixedHeader.find('th'), function (i, th) {
|
||||||
|
$(th).find('.sortable').removeClass('desc asc').addClass(($(th).data('field') === sortName || $(th).data('sortName') === sortName) ? sortOrder : 'both');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.$tableBody.on('scroll', function () {
|
this.$tableBody.on('scroll', function () {
|
||||||
that.$fixedBody.find('table').css('top', -$(this).scrollTop());
|
that.$fixedBody.find('table').css('top', -$(this).scrollTop());
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue