return promise object from fetch

This commit is contained in:
afc163 2015-08-05 11:04:00 +08:00
parent cfaabbb825
commit 6d2cf352c3
2 changed files with 4 additions and 2 deletions

View File

@ -65,7 +65,9 @@ var dataSource = new Table.DataSource({
});
function fetch() {
dataSource.fetch();
dataSource.fetch().then(function() {
console.log('fetch done');
});
}
React.render(<div>

View File

@ -349,7 +349,7 @@ var AntTable = React.createClass({
}
// remote 使 this.dataSource
let dataSource = this.getRemoteDataSource();
jQuery.ajax({
return jQuery.ajax({
url: dataSource.url,
data: dataSource.getParams.apply(this, this.prepareParamsArguments(state)) || {},
headers: dataSource.headers,