This commit is contained in:
wanghaoo 2018-10-11 22:53:27 +08:00
parent 83fed7b012
commit 9726e462b7
3 changed files with 12 additions and 4 deletions

View File

@ -248,6 +248,10 @@ var Table = function (_Component) {
if (this.columnManager.isAnyColumnsFixed()) {
this.syncFixedTableRowHeight();
}
//如果contentDomWidth为0则需要重新计算适应模态框中表格;
if (this.contentDomWidth == 0) {
this.computeTableWidth();
}
};
Table.prototype.componentWillUnmount = function componentWillUnmount() {
@ -438,7 +442,9 @@ var Table = function (_Component) {
dataindex: column.dataIndex,
datasource: _this2.props.data,
format: column.format,
filterdropdown: column.filterDropdown
filterdropdown: column.filterDropdown,
filterdropdownauto: column.filterDropdownAuto, //是否自定义数据
filterdropdowndata: column.filterDropdownData //自定义数据格式
});
}
});

View File

@ -257,7 +257,7 @@ var TableHeader = function (_Component) {
//下拉框选择
case 'dropdown':
var selectDataSource = [];
if (rows.length > 0) {
if (rows.length > 0 && (rows[1][index]['filterdropdownauto'] || 'auto') == 'auto') {
var hash = {};
//处理下拉重复对象组装dropdown
selectDataSource = Array.from(rows[1][0].datasource, function (x) {
@ -267,6 +267,8 @@ var TableHeader = function (_Component) {
hash[next.key] ? '' : hash[next.key] = true && item.push(next);
return item;
}, []);
} else {
selectDataSource = rows[1][index]['filterdropdowndata'];
}
return _react2["default"].createElement(_FilterType2["default"], {
rendertype: type,
@ -311,7 +313,7 @@ var TableHeader = function (_Component) {
// let a = this.props.rows[0];
};var _row = [];
_this.props.rows[0].forEach(function (item) {
_this.props.rows[0] && _this.props.rows[0].forEach(function (item) {
var newItem = item.key != "checkbox" ? (0, _utils.ObjectAssign)(item) : item;
_row.push(newItem);
});

View File

@ -1,6 +1,6 @@
{
"name": "bee-table",
"version": "1.4.14",
"version": "1.4.15",
"description": "Table ui component for react",
"keywords": [
"react",