merge
This commit is contained in:
commit
1b1a719288
|
@ -348,9 +348,16 @@ var Table = function (_Component) {
|
||||||
_this.onBodyMouseLeave = _this.onBodyMouseLeave.bind(_this);
|
_this.onBodyMouseLeave = _this.onBodyMouseLeave.bind(_this);
|
||||||
_this.tableUid = null;
|
_this.tableUid = null;
|
||||||
_this.contentTable = null;
|
_this.contentTable = null;
|
||||||
|
_this.leftColumnsLength; //左侧固定列的长度
|
||||||
|
_this.centerColumnsLength; //非固定列的长度
|
||||||
return _this;
|
return _this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Table.prototype.componentWillMount = function componentWillMount() {
|
||||||
|
this.centerColumnsLength = this.columnManager.centerColumns().length;
|
||||||
|
this.leftColumnsLength = this.columnManager.leftColumns().length;
|
||||||
|
};
|
||||||
|
|
||||||
Table.prototype.componentDidMount = function componentDidMount() {
|
Table.prototype.componentDidMount = function componentDidMount() {
|
||||||
this.getTableUID();
|
this.getTableUID();
|
||||||
_utils.EventUtil.addHandler(this.contentTable, 'keydown', this.onKeyDown);
|
_utils.EventUtil.addHandler(this.contentTable, 'keydown', this.onKeyDown);
|
||||||
|
@ -830,7 +837,7 @@ var Table = function (_Component) {
|
||||||
var onRowDoubleClick = props.onRowDoubleClick;
|
var onRowDoubleClick = props.onRowDoubleClick;
|
||||||
|
|
||||||
var expandIconAsCell = fixed !== 'right' ? props.expandIconAsCell : false;
|
var expandIconAsCell = fixed !== 'right' ? props.expandIconAsCell : false;
|
||||||
var expandIconColumnIndex = fixed !== 'right' ? props.expandIconColumnIndex : -1;
|
var expandIconColumnIndex = props.expandIconColumnIndex;
|
||||||
if (props.lazyLoad && props.lazyLoad.preHeight && indent == 0) {
|
if (props.lazyLoad && props.lazyLoad.preHeight && indent == 0) {
|
||||||
rst.push(_react2["default"].createElement(_TableRow2["default"], { height: props.lazyLoad.preHeight, columns: [], className: '', key: 'table_row_first', store: this.store, visible: true }));
|
rst.push(_react2["default"].createElement(_TableRow2["default"], { height: props.lazyLoad.preHeight, columns: [], className: '', key: 'table_row_first', store: this.store, visible: true }));
|
||||||
}
|
}
|
||||||
|
@ -957,7 +964,9 @@ var Table = function (_Component) {
|
||||||
expandedIcon: props.expandedIcon,
|
expandedIcon: props.expandedIcon,
|
||||||
collapsedIcon: props.collapsedIcon,
|
collapsedIcon: props.collapsedIcon,
|
||||||
lazyStartIndex: lazyCurrentIndex,
|
lazyStartIndex: lazyCurrentIndex,
|
||||||
lazyEndIndex: lazyEndIndex
|
lazyEndIndex: lazyEndIndex,
|
||||||
|
centerColumnsLength: this.centerColumnsLength,
|
||||||
|
leftColumnsLength: this.leftColumnsLength
|
||||||
})));
|
})));
|
||||||
this.treeRowIndex++;
|
this.treeRowIndex++;
|
||||||
var subVisible = visible && isRowExpanded;
|
var subVisible = visible && isRowExpanded;
|
||||||
|
|
|
@ -593,6 +593,12 @@ var TableRow = function (_Component) {
|
||||||
isHiddenExpandIcon: isHiddenExpandIcon
|
isHiddenExpandIcon: isHiddenExpandIcon
|
||||||
});
|
});
|
||||||
var isExpandIconAsCell = expandIconAsCell ? clsPrefix + '-expand-columns-in-body' : '';
|
var isExpandIconAsCell = expandIconAsCell ? clsPrefix + '-expand-columns-in-body' : '';
|
||||||
|
var expandIndexInThisTable;
|
||||||
|
if (this.props.fixed === 'right') {
|
||||||
|
expandIndexInThisTable = expandIconColumnIndex - this.props.leftColumnsLength - this.props.centerColumnsLength;
|
||||||
|
} else {
|
||||||
|
expandIndexInThisTable = expandIconColumnIndex;
|
||||||
|
}
|
||||||
for (var i = 0; i < columns.length; i++) {
|
for (var i = 0; i < columns.length; i++) {
|
||||||
if (expandIconAsCell && i === 0 && !showSum) {
|
if (expandIconAsCell && i === 0 && !showSum) {
|
||||||
cells.push(_react2["default"].createElement(
|
cells.push(_react2["default"].createElement(
|
||||||
|
@ -604,7 +610,7 @@ var TableRow = function (_Component) {
|
||||||
expandIcon
|
expandIcon
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
var isColumnHaveExpandIcon = expandIconAsCell || expandRowByClick || showSum ? false : i === expandIconColumnIndex;
|
var isColumnHaveExpandIcon = expandIconAsCell || expandRowByClick || showSum ? false : i === expandIndexInThisTable;
|
||||||
cells.push(_react2["default"].createElement(_TableCell2["default"], {
|
cells.push(_react2["default"].createElement(_TableCell2["default"], {
|
||||||
clsPrefix: clsPrefix,
|
clsPrefix: clsPrefix,
|
||||||
record: record,
|
record: record,
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
10
src/Table.js
10
src/Table.js
|
@ -160,6 +160,12 @@ class Table extends Component {
|
||||||
this.onBodyMouseLeave = this.onBodyMouseLeave.bind(this);
|
this.onBodyMouseLeave = this.onBodyMouseLeave.bind(this);
|
||||||
this.tableUid = null;
|
this.tableUid = null;
|
||||||
this.contentTable = null;
|
this.contentTable = null;
|
||||||
|
this.leftColumnsLength //左侧固定列的长度
|
||||||
|
this.centerColumnsLength //非固定列的长度
|
||||||
|
}
|
||||||
|
componentWillMount() {
|
||||||
|
this.centerColumnsLength = this.columnManager.centerColumns().length
|
||||||
|
this.leftColumnsLength = this.columnManager.leftColumns().length
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
@ -672,7 +678,7 @@ class Table extends Component {
|
||||||
const onRowDoubleClick = props.onRowDoubleClick;
|
const onRowDoubleClick = props.onRowDoubleClick;
|
||||||
|
|
||||||
const expandIconAsCell = fixed !== 'right' ? props.expandIconAsCell : false;
|
const expandIconAsCell = fixed !== 'right' ? props.expandIconAsCell : false;
|
||||||
const expandIconColumnIndex = fixed !== 'right' ? props.expandIconColumnIndex : -1;
|
const expandIconColumnIndex = props.expandIconColumnIndex
|
||||||
if(props.lazyLoad && props.lazyLoad.preHeight && indent == 0){
|
if(props.lazyLoad && props.lazyLoad.preHeight && indent == 0){
|
||||||
rst.push(
|
rst.push(
|
||||||
<TableRow height={props.lazyLoad.preHeight} columns={[]} className='' key={'table_row_first'} store={this.store} visible = {true}/>
|
<TableRow height={props.lazyLoad.preHeight} columns={[]} className='' key={'table_row_first'} store={this.store} visible = {true}/>
|
||||||
|
@ -804,6 +810,8 @@ class Table extends Component {
|
||||||
collapsedIcon={props.collapsedIcon}
|
collapsedIcon={props.collapsedIcon}
|
||||||
lazyStartIndex = {lazyCurrentIndex}
|
lazyStartIndex = {lazyCurrentIndex}
|
||||||
lazyEndIndex = {lazyEndIndex}
|
lazyEndIndex = {lazyEndIndex}
|
||||||
|
centerColumnsLength={this.centerColumnsLength}
|
||||||
|
leftColumnsLength={this.leftColumnsLength}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
this.treeRowIndex++;
|
this.treeRowIndex++;
|
||||||
|
|
|
@ -476,6 +476,12 @@ class TableRow extends Component{
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
let isExpandIconAsCell = expandIconAsCell ? `${clsPrefix}-expand-columns-in-body` : '';
|
let isExpandIconAsCell = expandIconAsCell ? `${clsPrefix}-expand-columns-in-body` : '';
|
||||||
|
var expandIndexInThisTable
|
||||||
|
if(this.props.fixed === 'right'){
|
||||||
|
expandIndexInThisTable = expandIconColumnIndex - this.props.leftColumnsLength-this.props.centerColumnsLength
|
||||||
|
}else {
|
||||||
|
expandIndexInThisTable = expandIconColumnIndex
|
||||||
|
}
|
||||||
for (let i = 0; i < columns.length; i++) {
|
for (let i = 0; i < columns.length; i++) {
|
||||||
if (expandIconAsCell && i === 0 && !showSum ) {
|
if (expandIconAsCell && i === 0 && !showSum ) {
|
||||||
cells.push(
|
cells.push(
|
||||||
|
@ -488,7 +494,7 @@ class TableRow extends Component{
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const isColumnHaveExpandIcon = (expandIconAsCell || expandRowByClick || showSum)
|
const isColumnHaveExpandIcon = (expandIconAsCell || expandRowByClick || showSum)
|
||||||
? false : (i === expandIconColumnIndex);
|
? false : (i === expandIndexInThisTable);
|
||||||
cells.push(
|
cells.push(
|
||||||
<TableCell
|
<TableCell
|
||||||
clsPrefix={clsPrefix}
|
clsPrefix={clsPrefix}
|
||||||
|
|
Loading…
Reference in New Issue