提交 b53e76af 编写于 作者: A afc163

sort demo

上级 b9069c3a
......@@ -20,6 +20,7 @@ var columns = [{
}];
function resolve(result) {
console.log(this.loadData);
return result.data;
}
......
......@@ -7,4 +7,43 @@
---
````jsx
var Table = antd.Table;
var columns = [{
title: '姓名',
dataIndex: 'name'
}, {
title: '年龄',
dataIndex: 'age',
filter: function() {
return [{
text: '选项一'
value: 'value1'
}, {
text: '选项二'
value: 'value2'
}];
},
onFilter: function(item) {
this.props.dataSource += '?age=' + item.value;
this.loadData();
},
onSorter: function(a, b) {
return a > b;
}
}, {
title: '地址',
dataIndex: 'address'
}];
var data = [{
name: '胡彦斌',
age: 32,
address: '西湖区湖底公园1号'
}, {
name: '胡彦祖',
age: 42,
address: '西湖区湖底公园1号'
}];
React.render(<Table columns={columns} data={data} />
, document.getElementById('components-table-demo-sort'));
````
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册