diff --git a/build/Table.js b/build/Table.js index c169015..105062b 100644 --- a/build/Table.js +++ b/build/Table.js @@ -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 //自定义数据格式 }); } }); diff --git a/build/TableHeader.js b/build/TableHeader.js index fb7fdf3..d7364cc 100644 --- a/build/TableHeader.js +++ b/build/TableHeader.js @@ -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); }); diff --git a/package.json b/package.json index 1c54f62..3705454 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bee-table", - "version": "1.4.14", + "version": "1.4.15", "description": "Table ui component for react", "keywords": [ "react",