Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
cbf2681c
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,发现更多精彩内容 >>
提交
cbf2681c
编写于
7月 15, 2015
作者:
Y
yiminghe
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of github.com:ant-design/ant-design
上级
7c37203f
d2594cab
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
70 deletion
+39
-70
.editorconfig
.editorconfig
+11
-0
components/table/demo/row-selection.md
components/table/demo/row-selection.md
+4
-4
components/table/index.jsx
components/table/index.jsx
+13
-6
scripts/demo.js
scripts/demo.js
+4
-6
static/style.css
static/style.css
+7
-54
未找到文件。
.editorconfig
0 → 100644
浏览文件 @
cbf2681c
# editorconfig.org
root = true
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
components/table/demo/row-selection.md
浏览文件 @
cbf2681c
...
@@ -37,11 +37,11 @@ var data = [{
...
@@ -37,11 +37,11 @@ var data = [{
// 通过 rowSelection 对象表明需要行选择
// 通过 rowSelection 对象表明需要行选择
var
rowSelection
=
{
var
rowSelection
=
{
onSelect
:
function
(
record
,
selected
)
{
onSelect
:
function
(
record
,
selected
,
selectedRows
)
{
console
.
log
(
record
,
selected
);
console
.
log
(
record
,
selected
,
selectedRows
);
},
},
onSelectAll
:
function
(
selected
)
{
onSelectAll
:
function
(
selected
,
selectedRows
)
{
console
.
log
(
selected
);
console
.
log
(
selected
,
selectedRows
);
}
}
};
};
...
...
components/table/index.jsx
浏览文件 @
cbf2681c
...
@@ -104,7 +104,6 @@ let AntTable = React.createClass({
...
@@ -104,7 +104,6 @@ let AntTable = React.createClass({
this
.
fetch
();
this
.
fetch
();
},
},
handleSelect
(
rowIndex
,
checked
)
{
handleSelect
(
rowIndex
,
checked
)
{
let
selectedRow
=
this
.
state
.
data
[
rowIndex
-
1
];
if
(
checked
)
{
if
(
checked
)
{
this
.
state
.
selectedRowKeys
.
push
(
rowIndex
);
this
.
state
.
selectedRowKeys
.
push
(
rowIndex
);
}
else
{
}
else
{
...
@@ -116,17 +115,25 @@ let AntTable = React.createClass({
...
@@ -116,17 +115,25 @@ let AntTable = React.createClass({
selectedRowKeys
:
this
.
state
.
selectedRowKeys
selectedRowKeys
:
this
.
state
.
selectedRowKeys
});
});
if
(
this
.
props
.
rowSelection
.
onSelect
)
{
if
(
this
.
props
.
rowSelection
.
onSelect
)
{
this
.
props
.
rowSelection
.
onSelect
(
selectedRow
,
checked
);
let
currentRow
=
this
.
state
.
data
[
rowIndex
-
1
];
let
selectedRows
=
this
.
state
.
data
.
filter
((
row
,
i
)
=>
{
return
this
.
state
.
selectedRowKeys
.
indexOf
(
i
+
1
)
>=
0
;
});
this
.
props
.
rowSelection
.
onSelect
(
currentRow
,
checked
,
selectedRows
);
}
}
},
},
handleSelectAllRow
(
checked
)
{
handleSelectAllRow
(
checked
)
{
this
.
setState
({
var
selectedRowKeys
=
checked
?
this
.
state
.
data
.
map
(
function
(
item
,
i
)
{
selectedRowKeys
:
checked
?
this
.
state
.
data
.
map
(
function
(
item
,
i
)
{
return
i
+
1
;
return
i
+
1
;
})
:
[]
})
:
[];
this
.
setState
({
selectedRowKeys
:
selectedRowKeys
});
});
if
(
this
.
props
.
rowSelection
.
onSelectAll
)
{
if
(
this
.
props
.
rowSelection
.
onSelectAll
)
{
this
.
props
.
rowSelection
.
onSelectAll
(
checked
);
let
selectedRows
=
this
.
state
.
data
.
filter
((
row
,
i
)
=>
{
return
selectedRowKeys
.
indexOf
(
i
+
1
)
>=
0
;
});
this
.
props
.
rowSelection
.
onSelectAll
(
checked
,
selectedRows
);
}
}
},
},
handlePageChange
:
function
(
current
)
{
handlePageChange
:
function
(
current
)
{
...
...
scripts/demo.js
浏览文件 @
cbf2681c
...
@@ -16,7 +16,7 @@ $(function () {
...
@@ -16,7 +16,7 @@ $(function () {
return
searchData
.
map
(
function
(
s
)
{
return
searchData
.
map
(
function
(
s
)
{
return
<
Option
sData
=
{
s
}
key
=
{
s
.
title
}
>
return
<
Option
sData
=
{
s
}
key
=
{
s
.
title
}
>
<
strong
>
{
s
.
title
}
<
/strong
>
<
strong
>
{
s
.
title
}
<
/strong
>
&
nbsp
;
&
nbsp
;
<
span
>
{
s
.
desc
}
<
/span
>
<
span
>
{
s
.
desc
}
<
/span
>
<
/Option>
;
<
/Option>
;
});
});
...
@@ -33,13 +33,11 @@ $(function () {
...
@@ -33,13 +33,11 @@ $(function () {
},
},
render
()
{
render
()
{
return
<
Select
style
=
{{
width
:
200
}}
return
<
Select
combobox
style
=
{{
width
:
200
}}
placeholder
=
"
Select Components
"
onSelect
=
{
this
.
handleSelect
}
onChange
=
{
this
.
handleSelect
}
dropdownMenuStyle
=
{{
maxHeight
:
200
,
overflow
:
'
auto
'
}}
dropdownMenuStyle
=
{{
maxHeight
:
200
,
overflow
:
'
auto
'
}}
searchPlaceholder
=
"
Filter Components
"
searchPlaceholder
=
"
搜索组件...
"
renderDropdownToBody
=
{
true
}
renderDropdownToBody
=
{
true
}
showSearch
=
{
true
}
filterOption
=
{
this
.
filterOption
}
>
{
this
.
getOptions
()}
<
/Select>
;
filterOption
=
{
this
.
filterOption
}
>
{
this
.
getOptions
()}
<
/Select>
;
}
}
});
});
...
...
static/style.css
浏览文件 @
cbf2681c
...
@@ -163,71 +163,24 @@ a.logo {
...
@@ -163,71 +163,24 @@ a.logo {
position
:
relative
;
position
:
relative
;
}
}
.search
input
[
type
=
"text"
]
{
#autoComplete
.ant-select-selection--single
{
border
:
transparent
;
border
:
transparent
;
outline
:
none
;
outline
:
none
;
width
:
160px
;
width
:
160px
;
height
:
2
2
px
;
height
:
2
8
px
;
padding
:
0
0
0
20
px
;
line-height
:
28
px
;
color
:
#999
;
color
:
#999
;
transition
:
padding
.3s
cubic-bezier
(
0.075
,
0.82
,
0.165
,
1
);
transition
:
padding
.3s
cubic-bezier
(
0.075
,
0.82
,
0.165
,
1
);
font-size
:
14px
;
font-size
:
14px
;
box-shadow
:
none
;
}
}
.search
input
::-webkit-input-placeholder
,
#autoComplete
input
::-webkit-input-placeholder
,
.search
input
::-moz-placeholder
,
#autoComplete
input
::-moz-placeholder
,
.search
input
:-ms-input-placeholder
{
#autoComplete
input
:-ms-input-placeholder
{
color
:
#CADCE3
;
color
:
#CADCE3
;
}
}
.search
form
.focus
{
padding
:
0
20px
0
0
;
}
.search
button
{
position
:
absolute
;
outline
:
none
;
background
:
transparent
;
border
:
transparent
;
top
:
5px
;
width
:
15px
;
height
:
15px
;
padding
:
0
;
left
:
30px
;
cursor
:
pointer
;
transition
:
left
.3s
cubic-bezier
(
0.075
,
0.82
,
0.165
,
1
);
}
.search
button
:before
,
.search
button
:after
{
content
:
""
;
display
:
block
;
}
.search
button
:before
{
width
:
12px
;
height
:
12px
;
border-radius
:
6px
;
border
:
2px
solid
#CADCE3
;
background
:
#ffffff
;
position
:
absolute
;
top
:
0
}
.search
button
:after
{
width
:
2px
;
height
:
6px
;
background
:
#CADCE3
;
position
:
absolute
;
transform
:
rotate
(
-45deg
);
left
:
10px
;
top
:
8px
;
}
.search
input
:focus
~
button
{
left
:
170px
;
}
.nav
{
.nav
{
width
:
30%
;
width
:
30%
;
height
:
80px
;
height
:
80px
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录