From 454e5cc22be83d489d7319cd14210b0352b1c237 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Fri, 7 Aug 2015 00:16:21 +0800 Subject: [PATCH 1/4] upgrade rc-select. Fixes #118 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ea771ce52a..1d30c13736 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "rc-pagination": "~1.1.0", "rc-progress": "~1.0.0", "rc-radio": "~2.0.0", - "rc-select": "~4.5.1", + "rc-select": "~4.5.2", "rc-slider": "~1.3.1", "rc-steps": "~1.1.4", "rc-switch": "~1.2.0", From ed549a19b3e818970cbcabd6a616e2bca85e045f Mon Sep 17 00:00:00 2001 From: yiminghe Date: Fri, 7 Aug 2015 00:34:06 +0800 Subject: [PATCH 2/4] upgrade rc-menu --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1d30c13736..d48619b42c 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,7 @@ "rc-dropdown": "~1.1.1", "rc-form-validation": "~2.4.7", "rc-input-number": "~2.0.1", - "rc-menu": "~3.4.0", + "rc-menu": "~3.5.0", "rc-notification": "~1.1.0", "rc-pagination": "~1.1.0", "rc-progress": "~1.0.0", From d60fca49930b5af30b8e7fabab73375e1072a816 Mon Sep 17 00:00:00 2001 From: yiminghe Date: Fri, 7 Aug 2015 01:03:42 +0800 Subject: [PATCH 3/4] fix datasource --- components/table/demo/ajax.md | 30 ++++++++++++++++++++---------- components/table/index.jsx | 20 +++++++++++++++----- 2 files changed, 35 insertions(+), 15 deletions(-) diff --git a/components/table/demo/ajax.md b/components/table/demo/ajax.md index 445e60bb44..3fb3e12909 100644 --- a/components/table/demo/ajax.md +++ b/components/table/demo/ajax.md @@ -56,7 +56,7 @@ var dataSource = new Table.DataSource({ sortField: sorter.field, sortOrder: sorter.order }; - for (let key in filters) { + for (var key in filters) { params[key] = filters[key]; } console.log('请求参数:', params); @@ -64,14 +64,24 @@ var dataSource = new Table.DataSource({ } }); -function fetch() { - dataSource.fetch().then(function() { - console.log('fetch done'); - }); -} +var Test=React.createClass({ + getInitialState(){ + return { + dataSource:dataSource + }; + }, + refresh(){ + this.setState({ + dataSource: this.state.dataSource.clone() + }); + }, + render(){ + return
+ + + ; + } +}); -React.render(
-
- -, document.getElementById('components-table-demo-ajax')); +React.render(, document.getElementById('components-table-demo-ajax')); ```` diff --git a/components/table/index.jsx b/components/table/index.jsx index 6b9e526046..977e2a8c2f 100644 --- a/components/table/index.jsx +++ b/components/table/index.jsx @@ -16,13 +16,25 @@ function defaultResolve(data) { } class DataSource { - constructor(config) { + init(config) { + this.config = config; this.url = config.url || ''; this.resolve = config.resolve || defaultResolve; this.getParams = config.getParams || noop; this.getPagination = config.getPagination || noop; this.headers = config.headers || {}; - this.fetch = noop; + } + + constructor(config) { + if (config) { + this.init(config); + } + } + + clone() { + var d = new DataSource(); + d.init(this.config); + return d; } } @@ -90,9 +102,7 @@ var AntTable = React.createClass({ }, getRemoteDataSource() { - let dataSource = this.props.dataSource; - dataSource.fetch = this.fetch; - return dataSource; + return this.props.dataSource; }, toggleSortOrder(order, column) { From 575af92b9248c84f2c5d6904c1b88e9138558a7f Mon Sep 17 00:00:00 2001 From: SimaQ Date: Fri, 7 Aug 2015 09:57:12 +0800 Subject: [PATCH 4/4] update email validation demo --- components/validation/demo/basic.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/validation/demo/basic.md b/components/validation/demo/basic.md index d0c7580a0f..1224ea7cee 100644 --- a/components/validation/demo/basic.md +++ b/components/validation/demo/basic.md @@ -157,8 +157,8 @@ var Form = React.createClass({
- - + + {status.email.errors ?
{status.email.errors.join(',')}
: null}