|
@@ -7,7 +7,7 @@
|
|
|
window.sort=require('../utilities/sort');
|
|
window.sort=require('../utilities/sort');
|
|
|
window.Header = function getHeader(object) {
|
|
window.Header = function getHeader(object) {
|
|
|
this._header = object.el || '#header'; //基点元素
|
|
this._header = object.el || '#header'; //基点元素
|
|
|
- this._column = object.column; //列名
|
|
|
|
|
|
|
+ this._columns = object.column; //列名
|
|
|
this._data = object.data; //被排序数据
|
|
this._data = object.data; //被排序数据
|
|
|
this._restorationColumn = object.restorationColumn; //恢复原数据基准字段
|
|
this._restorationColumn = object.restorationColumn; //恢复原数据基准字段
|
|
|
this._fixedTop = object.fixedTop || 0; //同级浮动元素高度,使当前元素追加该元素高度浮动
|
|
this._fixedTop = object.fixedTop || 0; //同级浮动元素高度,使当前元素追加该元素高度浮动
|
|
@@ -41,6 +41,14 @@ window.Header = function getHeader(object) {
|
|
|
_parentNodeTemp.css('margin-left',"");
|
|
_parentNodeTemp.css('margin-left',"");
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
+ let resetTrWidth = function(){
|
|
|
|
|
+ _parentNodeTemp.find('tr').css('width',$(document).width());
|
|
|
|
|
+ this._columns.forEach(function (column){
|
|
|
|
|
+ $("#dom_"+column.name+"_temp").css('width',$("#dom_"+column.name).width())
|
|
|
|
|
+ })
|
|
|
|
|
+ };
|
|
|
|
|
+ $(window).resize(resetTrWidth);
|
|
|
|
|
+ setTimeout(resetTrWidth,200)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -130,7 +138,7 @@ window.Header = function getHeader(object) {
|
|
|
};
|
|
};
|
|
|
//追加表头字段
|
|
//追加表头字段
|
|
|
function append() {
|
|
function append() {
|
|
|
- _this._column.forEach(function (column) {
|
|
|
|
|
|
|
+ _this._columns.forEach(function (column) {
|
|
|
if (column.customization){
|
|
if (column.customization){
|
|
|
let _th = $("<th id='dom_"+column.name+"'><span style='display: inline-block'></span></th>");
|
|
let _th = $("<th id='dom_"+column.name+"'><span style='display: inline-block'></span></th>");
|
|
|
$(_th.children()[0]).append(column.dom);
|
|
$(_th.children()[0]).append(column.dom);
|
|
@@ -171,7 +179,7 @@ window.Header = function getHeader(object) {
|
|
|
_parentNodeTemp.height(height);
|
|
_parentNodeTemp.height(height);
|
|
|
_parentNodeTemp.attr('id',_parentNode.attr('id')+"Temp");
|
|
_parentNodeTemp.attr('id',_parentNode.attr('id')+"Temp");
|
|
|
$(_this._header+"Roll").append(_parentNodeTemp);
|
|
$(_this._header+"Roll").append(_parentNodeTemp);
|
|
|
- _this._column.forEach(function (column) {
|
|
|
|
|
|
|
+ _this._columns.forEach(function (column) {
|
|
|
let column_dom = $('#dom_'+column.name);
|
|
let column_dom = $('#dom_'+column.name);
|
|
|
let column_dom_temp = column_dom.clone();
|
|
let column_dom_temp = column_dom.clone();
|
|
|
let columnNameDom = column_dom_temp.children()[0];
|
|
let columnNameDom = column_dom_temp.children()[0];
|