Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
a707df52
A
ant-design
项目概览
wanjj_1210
/
ant-design
与 Fork 源项目一致
从无法访问的项目Fork
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
ant-design
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a707df52
编写于
11月 03, 2015
作者:
A
afc163
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add filterMultiple in table column, close #442
上级
be42f568
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
7 deletion
+24
-7
components/table/demo/head.md
components/table/demo/head.md
+14
-3
components/table/filterDropdown.jsx
components/table/filterDropdown.jsx
+6
-1
components/table/index.md
components/table/index.md
+4
-3
未找到文件。
components/table/demo/head.md
浏览文件 @
a707df52
...
...
@@ -2,7 +2,7 @@
-
order: 6
对某一列数据进行筛选,使用列的
`filter`
属性来指定
筛选的列表
。
对某一列数据进行筛选,使用列的
`filter`
属性来指定
需要筛选菜单的列,
`onFilter`
用于筛选当前数据,
`filterMultiple`
用于指定多选和单选
。
对某一列数据进行排序,通过指定列的
`sorter`
函数即可启动排序按钮。
`sorter: function(a, b) { ... }`
, a、b 为比较的两个列数据。
...
...
@@ -38,6 +38,17 @@ const columns = [{
},
{
title
:
'
地址
'
,
dataIndex
:
'
address
'
,
filters
:
[{
text
:
'
南湖
'
,
value
:
'
南湖
'
},
{
text
:
'
西湖
'
,
value
:
'
西湖
'
}],
filterMultiple
:
false
,
onFilter
:
function
(
value
,
record
)
{
return
record
.
address
.
indexOf
(
value
)
===
0
;
},
sorter
:
function
(
a
,
b
)
{
return
a
.
address
.
length
-
b
.
address
.
length
;
}
...
...
@@ -47,7 +58,7 @@ const data = [{
key
:
'
1
'
,
name
:
'
胡斌
'
,
age
:
32
,
address
:
'
西
湖区湖底公园1号
'
address
:
'
南
湖区湖底公园1号
'
},
{
key
:
'
2
'
,
name
:
'
胡彦祖
'
,
...
...
@@ -57,7 +68,7 @@ const data = [{
key
:
'
3
'
,
name
:
'
李大嘴
'
,
age
:
32
,
address
:
'
西
湖区湖底公园123号
'
address
:
'
南
湖区湖底公园123号
'
},
{
key
:
'
4
'
,
name
:
'
李秀莲大嘴哥
'
,
...
...
components/table/filterDropdown.jsx
浏览文件 @
a707df52
...
...
@@ -49,7 +49,12 @@ let FilterMenu = React.createClass({
},
render
()
{
let
column
=
this
.
props
.
column
;
let
menus
=
<
Menu
multiple
=
{
true
}
// default multiple selection in filter dropdown
let
multiple
=
true
;
if
(
'
filterMultiple
'
in
column
)
{
multiple
=
column
.
filterMultiple
;
}
let
menus
=
<
Menu
multiple
=
{
multiple
}
prefixCls
=
"ant-dropdown-menu"
className
=
"ant-table-filter-dropdown"
onSelect
=
{
this
.
setSelectedKeys
}
...
...
components/table/index.md
浏览文件 @
a707df52
...
...
@@ -79,13 +79,14 @@ var dataSource = new Table.DataSource({
|------------|----------------------------|-----------------|---------------------|---------|
| title | 列头显示文字 | String or React.Element | | |
| dataIndex | 列数据在 data 中对应的 key | String | | |
| colSpan | 表头列合并,设置为 0 时
,不渲染 | Number
| | |
| colSpan | 表头列合并,设置为 0 时
,不渲染 | Number
| | |
| key | React 需要的 key | String | | |
| render | 生成复杂数据的渲染函数,参数分别为当前列的值,当前列数据,列索引,@return里面可以设置表格
[
行/列合并
](
#demo-colspan-rowspan
)
| Function(text, record, index) {} | | |
| render | 生成复杂数据的渲染函数,参数分别为当前列的值,当前列数据,列索引,@return里面可以设置表格
[
行/列合并
](
#demo-colspan-rowspan
)
| Function(text, record, index) {} |
| |
| filters | 表头的筛选菜单项 | Array | | |
| onFilter | 本地模式下,确定筛选的运行函数 | Function | | |
| filterMultiple | 是否多选 | Boolean | | true |
| sorter | 排序函数,本地模式下为一个函数,远程模式下为布尔值 | Function or Boolean | | 无 |
| width | 列宽度 | String or Number |
| 无
|
| width | 列宽度 | String or Number |
| 无
|
### dataSource
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录