This commit is contained in:
wanghaoo 2018-10-16 19:07:13 +08:00
commit 50520aaf6b
12 changed files with 66 additions and 31 deletions

View File

@ -1,3 +1,8 @@
<a name="1.4.17"></a>
## [1.4.17](https://github.com/tinper-bee/bee-table/compare/v1.4.16...v1.4.17) (2018-10-15)
<a name="1.4.16"></a>
## [1.4.16](https://github.com/tinper-bee/bee-table/compare/v1.4.15...v1.4.16) (2018-10-12)

View File

@ -130,6 +130,8 @@ class Demo extends Component {
| format | 针对过滤下拉设置日期类的格式 | string | YYYY-MM-DD |
| filterDropdownAuto | 设置下拉条件是否自动设置选项,`auto`自动根据当前数据生成,`manual`手动传入,可以使用`filterDropdownData`来传入自定义数据 | string | auto |
| filterDropdownData | 下拉条件自定义数据filterDropdownAuto=manual生效传入格式[{ key : "自定义", value : "自定义" }] | array | [] |
| filterDropdownFocus | 触发点击下拉条件的回调,一般用于异步点击请求数据使用 | function | () => () |
## 如何引用

View File

@ -447,7 +447,8 @@ var Table = function (_Component) {
format: column.format,
filterdropdown: column.filterDropdown,
filterdropdownauto: column.filterDropdownAuto, //是否自定义数据
filterdropdowndata: column.filterDropdownData //自定义数据格式
filterdropdowndata: column.filterDropdownData, //自定义数据格式
filterdropdownfocus: column.filterDropdownFocus //焦点触发函数回调
});
}
});

View File

@ -276,7 +276,8 @@ var TableHeader = function (_Component) {
data: selectDataSource,
onChange: _this.handlerFilterTextChange.bind(_this, dataIndex),
onSelectDropdown: _this.handlerFilterDropChange.bind(_this, dataIndex),
filterDropdown: rows[1][index]['filterdropdown']
filterDropdown: rows[1][index]['filterdropdown'],
onFocus: rows[1][index]['filterdropdownfocus']
});
//日期
case 'date':
@ -388,6 +389,7 @@ var TableHeader = function (_Component) {
}
if (filterable && index == rows.length - 1) {
da.children = _this2.filterRenderType(da['filtertype'], da.dataindex, i);
delete da.filterdropdownfocus;
}
if (draggable) {
return _react2["default"].createElement('th', _extends({}, da, {

View File

@ -1,7 +1,7 @@
/**
*
* @title 组合过滤和其他功能使用
* @description 在过滤数据行的基础上增加列拖拽动态菜单显示
* @description 在过滤数据行的基础上增加列拖拽动态菜单显示下拉条件动态传入自定义
*
*/
@ -100,6 +100,12 @@ const data27 = [
const MultiSelectTable = multiSelect(Table, Checkbox);
const ComplexTable = sort(MultiSelectTable, Icon);
class Demo27 extends Component {
constructor(props) {
super(props);
this.state = {
dropdownvalue: []
}
}
handlerFilterRowsChange = (key, val) => {
console.log('准备构建AJAX请求接收参数key=', key, ' value=', val);
}
@ -153,10 +159,12 @@ class Demo27 extends Component {
filterType: "dropdown",
filterDropdown: "hide",
filterDropdownAuto: "manual",//切换手动传入模式
filterDropdownData: [{
key: '数据',
value: '数据'
}]
filterDropdownData: this.state.dropdownvalue,
filterDropdownFocus: () => {
this.setState({
dropdownvalue: [{ key: "自定义数据1", value: "1" }, { key: "自定义数据2", value: "2" }]
});
}
},
{ title: "居住地址", width: 150, dataIndex: "address", key: "address", filterType: "dropdown", filterDropdown: "hide" },
];

File diff suppressed because one or more lines are too long

52
dist/demo.js vendored

File diff suppressed because one or more lines are too long

2
dist/demo.js.map vendored

File diff suppressed because one or more lines are too long

View File

@ -77,7 +77,7 @@ import 'bee-table/build/Table.css';
| format | 设置日期类的格式 | string | YYYY-MM-DD |
| filterDropdownAuto | 设置下拉条件是否自动设置选项,`auto`自动根据当前数据生成,`manual`手动传入,可以使用`filterDropdownData`来传入自定义数据 | string | auto |
| filterDropdownData | 下拉条件自定义数据filterDropdownAuto=manual生效传入格式[{ key : "自定义", value : "自定义" }] | array | [] |
| filterDropdownFocus | 触发点击下拉条件的回调,一般用于异步点击请求数据使用 | function | () => () |
{% include "mixin.md"%}

View File

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

View File

@ -354,7 +354,8 @@ class Table extends Component {
format: column.format,
filterdropdown: column.filterDropdown,
filterdropdownauto: column.filterDropdownAuto,//是否自定义数据
filterdropdowndata: column.filterDropdownData//自定义数据格式
filterdropdowndata: column.filterDropdownData,//自定义数据格式
filterdropdownfocus: column.filterDropdownFocus//焦点触发函数回调
});
}
});

View File

@ -265,6 +265,7 @@ class TableHeader extends Component {
onChange={this.handlerFilterTextChange.bind(this, dataIndex)}
onSelectDropdown={this.handlerFilterDropChange.bind(this, dataIndex)}
filterDropdown={rows[1][index]['filterdropdown']}
onFocus={rows[1][index]['filterdropdownfocus']}
/>
//日期
case 'date':
@ -312,6 +313,7 @@ class TableHeader extends Component {
}
if (filterable && index == rows.length - 1) {
da.children = this.filterRenderType(da['filtertype'], da.dataindex, i);
delete da.filterdropdownfocus;
}
if (draggable) {
return (<th {...da}