没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
import React,{Component} from "react";
import ReactDOM from "react-dom";
import "antd/dist/antd.css";
import "./index.css";
import { Table, Input, Button, Popconfirm, Form } from "antd";
const EditableContext = React.createContext(null); //
class EditableRow extends Component {
returnForm = React.createRef();
render() {
return (
<Form ref={this.returnForm} component={false}>
<EditableContext.Provider value={this.returnForm}>
<tr {...this.props} />
</EditableContext.Provider>
</Form>
);
}
}
class EditableCell extends Component {
state = {
editing: false
};
toggleEdit = () => {
const editing = !this.state.editing;
this.setState({ editing }, () => {
if (editing) {
this.input.focus();
import ReactDOM from "react-dom";
import "antd/dist/antd.css";
import "./index.css";
import { Table, Input, Button, Popconfirm, Form } from "antd";
const EditableContext = React.createContext(null); //
class EditableRow extends Component {
returnForm = React.createRef();
render() {
return (
<Form ref={this.returnForm} component={false}>
<EditableContext.Provider value={this.returnForm}>
<tr {...this.props} />
</EditableContext.Provider>
</Form>
);
}
}
class EditableCell extends Component {
state = {
editing: false
};
toggleEdit = () => {
const editing = !this.state.editing;
this.setState({ editing }, () => {
if (editing) {
this.input.focus();
}
});
};
save = (e) => {
const { record, handleSave } = this.props;
let values = this.form.current.getFieldsValue();
this.toggleEdit();
handleSave({ ...record, ...values });
};
renderCell = (form) => {
this.form = form;
const { children, dataIndex, record, title } = this.props;
const { editing } = this.state;
let formParams = {
one: {
name: dataIndex,
rules: [
{
required: true,
message: `${title} is required.`
}
],
initialValue: record[dataIndex]
}
};
return editing ? (
<Form.Item {...formParams.one} style={{ margin: 0 }}>
<Input
});
};
save = (e) => {
const { record, handleSave } = this.props;
let values = this.form.current.getFieldsValue();
this.toggleEdit();
handleSave({ ...record, ...values });
};
renderCell = (form) => {
this.form = form;
const { children, dataIndex, record, title } = this.props;
const { editing } = this.state;
let formParams = {
one: {
name: dataIndex,
rules: [
{
required: true,
message: `${title} is required.`
}
],
initialValue: record[dataIndex]
}
};
return editing ? (
<Form.Item {...formParams.one} style={{ margin: 0 }}>
<Input
剩余7页未读,继续阅读
资源评论
chuan_chuange
- 粉丝: 3
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功