fix(inputRender and Demo16):

修改render里面的参数使用...this.props,增加demo中的业务逻辑
This commit is contained in:
huyueb 2017-11-03 15:24:07 +08:00
parent 0b49f72812
commit f73c0facd2
3 changed files with 33 additions and 17 deletions

View File

@ -38,21 +38,49 @@ const data16 = [
];
class Demo16 extends Component {
constructor(props){
super(props);
this.state={
data:data16
}
}
expandedRowRender = () => {
return (
<Table
columns={columns16}
data={data16}
data={this.state.data}
title={currentData => <div>标题: 这是一个标题</div>}
footer={currentData => <div>表尾: 我是小尾巴</div>}
/>
);
};
getData=(expanded, record)=>{
//当点击展开的时候才去请求数据
if(expanded){
if(record.key==='1'){
this.setState({
data:[
{ a: "令狐冲", b: "男", c: 41, d: "操作", key: "1" },
{ a: "杨过", b: "男", c: 67, d: "操作", key: "2" }
]
})
}else{
this.setState({
data:[
{ a: "令狐冲", b: "男", c: 41, d: "操作", key: "1" },
]
})
}
}
}
render() {
return (
<Table
columns={columns16}
data={data16}
onExpand={this.getData}
expandedRowRender={this.expandedRowRender}
title={currentData => <div>标题: 这是一个标题</div>}
footer={currentData => <div>表尾: 我是小尾巴</div>}

File diff suppressed because one or more lines are too long

View File

@ -83,12 +83,8 @@ export default class InputRender extends Component {
format,
formItemClassName,
mesClassName,
isRequire,
check,
method,
errorMessage,
reg,
htmlType
...other
} = this.props;
let cellContent = "";
if (editable) {
@ -105,14 +101,10 @@ export default class InputRender extends Component {
<Form.FormItem
className={"formItem-style " + formItemClassName}
mesClassName={"errMessage-style " + mesClassName}
isRequire={isRequire}
change={this.handleChange}
blur={this.check}
htmlType={htmlType}
method={method}
errorMessage={errorMessage}
reg={reg}
check={this.checkValidate}
{...other}
>
<Input
name={name}
@ -133,14 +125,10 @@ export default class InputRender extends Component {
<Form.FormItem
className={"formItem-style " + formItemClassName}
mesClassName={"errMessage-style " + mesClassName}
isRequire={isRequire}
change={this.handleChange}
blur={this.check}
htmlType={htmlType}
method={method}
errorMessage={errorMessage}
reg={reg}
check={this.checkValidate}
{...other}
>
<Input
name={name}