Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wanjj_1210
ant-design
提交
91a749a8
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,发现更多精彩内容 >>
提交
91a749a8
编写于
7月 15, 2015
作者:
A
afc163
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move ant-checkbox into ant-form-item
上级
9d49d4b5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
51 addition
and
53 deletion
+51
-53
components/table/index.jsx
components/table/index.jsx
+10
-12
style/components/checkbox.less
style/components/checkbox.less
+2
-1
style/components/form.less
style/components/form.less
+39
-40
未找到文件。
components/table/index.jsx
浏览文件 @
91a749a8
...
...
@@ -4,6 +4,7 @@ import React from 'react';
import
jQuery
from
'
jquery
'
;
import
Table
from
'
rc-table
'
;
import
Dropdown
from
'
../dropdown
'
;
import
Checkbox
from
'
../checkbox
'
;
import
FilterMenu
from
'
./filterMenu
'
;
import
Pagination
from
'
../pagination
'
;
import
objectAssign
from
'
object-assign
'
;
...
...
@@ -102,15 +103,13 @@ let AntTable = React.createClass({
}
this
.
fetch
();
},
handleSelect
(
e
)
{
let
checked
=
e
.
currentTarget
.
checked
;
let
currentRowIndex
=
e
.
currentTarget
.
parentElement
.
parentElement
.
rowIndex
;
let
selectedRow
=
this
.
state
.
data
[
currentRowIndex
-
1
];
handleSelect
(
rowIndex
,
checked
)
{
let
selectedRow
=
this
.
state
.
data
[
rowIndex
];
if
(
checked
)
{
this
.
state
.
selectedRowKeys
.
push
(
currentR
owIndex
);
this
.
state
.
selectedRowKeys
.
push
(
r
owIndex
);
}
else
{
this
.
state
.
selectedRowKeys
=
this
.
state
.
selectedRowKeys
.
filter
(
function
(
i
)
{
return
currentR
owIndex
!==
i
;
return
r
owIndex
!==
i
;
});
}
this
.
setState
({
...
...
@@ -120,8 +119,7 @@ let AntTable = React.createClass({
this
.
props
.
rowSelection
.
onSelect
(
selectedRow
,
checked
);
}
},
handleSelectAllRow
(
e
)
{
let
checked
=
e
.
currentTarget
.
checked
;
handleSelectAllRow
(
checked
)
{
this
.
setState
({
selectedRowKeys
:
checked
?
this
.
state
.
data
.
map
(
function
(
item
,
i
)
{
return
i
+
1
;
...
...
@@ -139,9 +137,9 @@ let AntTable = React.createClass({
},
this
.
fetch
);
},
renderSelectionCheckBox
(
value
,
record
,
index
)
{
let
checked
=
this
.
state
.
selectedRowKeys
.
indexOf
(
index
+
1
)
>=
0
;
let
check
box
=
<
input
type
=
"checkbox"
checked
=
{
checked
}
onChange
=
{
this
.
handleSelect
}
/>
;
return
checkbox
;
let
rowIndex
=
index
+
1
;
// 从 1 开始
let
check
ed
=
this
.
state
.
selectedRowKeys
.
indexOf
(
rowIndex
)
>=
0
;
return
<
Checkbox
checked
=
{
checked
}
onChange
=
{
this
.
handleSelect
.
bind
(
this
,
rowIndex
)
}
label
=
""
/>
;
},
renderRowSelection
()
{
var
columns
=
this
.
props
.
columns
;
...
...
@@ -149,7 +147,7 @@ let AntTable = React.createClass({
let
checked
=
this
.
state
.
data
.
every
(
function
(
item
,
i
)
{
return
this
.
state
.
selectedRowKeys
.
indexOf
(
i
+
1
)
>=
0
;
},
this
);
let
checkboxAll
=
<
input
type
=
"checkbox"
checked
=
{
checked
}
onChange
=
{
this
.
handleSelectAllRow
}
/>;
let
checkboxAll
=
<
Checkbox
checked
=
{
checked
}
onChange
=
{
this
.
handleSelectAllRow
}
label
=
""
/>;
let
selectionColumn
=
{
key
:
'
selection-column
'
,
title
:
checkboxAll
,
...
...
style/components/checkbox.less
浏览文件 @
91a749a8
...
...
@@ -8,6 +8,7 @@
cursor: pointer;
outline: none;
display: inline-block;
vertical-align: middle;
.@{checkboxPrefixCls} {
&:after {
...
...
@@ -176,4 +177,4 @@
100% {
opacity: 0;
}
}
\ No newline at end of file
}
style/components/form.less
浏览文件 @
91a749a8
...
...
@@ -65,7 +65,7 @@ form {
font-size: @font-size-base;
padding: @input-padding-horizontal;
}
// input[type=file]
.@{css-prefix}upload {
padding-top: 7px;
...
...
@@ -74,52 +74,51 @@ form {
font-size: @font-size-base;
background: transparent;
}
}
// Radio & Checkbox
.@{css-prefix}radio,
.@{css-prefix}checkbox {
position: relative;
display: block;
margin-top: 10px;
margin-bottom: 10px;
height: @input-height-lg;
// Radio & Checkbox
.@{css-prefix}radio,
.@{css-prefix}checkbox {
position: relative;
display: block;
margin-top: 10px;
margin-bottom: 10px;
height: @input-height-lg;
label {
min-height: @line-height-computed;
padding: 7px 0 7px 20px;
margin-bottom: 0;
font-weight: normal;
cursor: pointer;
}
}
.@{css-prefix}radio input[type="radio"],
.@{css-prefix}radio-inline input[type="radio"],
.@{css-prefix}checkbox input[type="checkbox"],
.@{css-prefix}checkbox-inline input[type="checkbox"] {
position: absolute;
margin-left: -20px;
margin-top: 4px \9;
}
label {
min-height: @line-height-computed;
padding: 7px 0 7px 20px;
.@{css-prefix}radio + .@{css-prefix}radio,
.@{css-prefix}checkbox + .@{css-prefix}checkbox {
margin-top: -5px;
}
// Radios and checkboxes on same line
.@{css-prefix}radio-inline,
.@{css-prefix}checkbox-inline {
position: relative;
display: inline-block;
padding: 7px 20px;
padding-right: 0!important;
margin-bottom: 0;
margin-right: 10px;
vertical-align: middle;
font-weight: normal;
cursor: pointer;
}
}
.@{css-prefix}radio input[type="radio"],
.@{css-prefix}radio-inline input[type="radio"],
.@{css-prefix}checkbox input[type="checkbox"],
.@{css-prefix}checkbox-inline input[type="checkbox"] {
position: absolute;
margin-left: -20px;
margin-top: 4px \9;
}
.@{css-prefix}radio + .@{css-prefix}radio,
.@{css-prefix}checkbox + .@{css-prefix}checkbox {
margin-top: -5px;
}
// Radios and checkboxes on same line
.@{css-prefix}radio-inline,
.@{css-prefix}checkbox-inline {
position: relative;
display: inline-block;
padding: 7px 20px;
padding-right: 0!important;
margin-bottom: 0;
margin-right: 10px;
vertical-align: middle;
font-weight: normal;
cursor: pointer;
}
input[type="radio"],
input[type="checkbox"] {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录