diff --git a/demo/demolist/Demo0501.js b/demo/demolist/Demo0501.js
index de4483b..fc050e5 100644
--- a/demo/demolist/Demo0501.js
+++ b/demo/demolist/Demo0501.js
@@ -365,6 +365,13 @@ let dataSource = [
class Demo0501 extends Component {
constructor(props, context) {
super(props);
+ this.state = {
+ dataSource: dataSource,
+ editingRowsMap: {},
+ currentIndex: null,
+ errorEditFlag: false
+ };
+
this.columns = [
{
title: "员工编号",
@@ -421,13 +428,6 @@ class Demo0501 extends Component {
}
];
- this.state = {
- dataSource: dataSource,
- editingRowsMap: {},
- currentIndex: null,
- errorEditFlag: false
- };
-
this.originData = {};
}
@@ -449,6 +449,15 @@ class Demo0501 extends Component {
this.setState({ editingRowsMap, dataSource });
};
+ delete = index => () => {
+ if (index === null) return;
+ let { dataSource } = this.state;
+ dataSource.splice(index,1);
+ this.setState({
+ dataSource:dataSource
+ });
+ }
+
commitChange = index => () => {
if (this.state.errorEditFlag) return;
let editingRowsMap = { ...this.state.editingRowsMap };
@@ -492,6 +501,9 @@ class Demo0501 extends Component {
+
);
};
diff --git a/demo/demolist/Demo1201.js b/demo/demolist/Demo1201.js
index d97d3b8..d23c5dc 100644
--- a/demo/demolist/Demo1201.js
+++ b/demo/demolist/Demo1201.js
@@ -11,28 +11,11 @@ import {Button,Tooltip} from "tinper-bee";
import Table from "../../src";
const columns = [
- {
- title: "员工编号", dataIndex: "a", key: "a", width: 120, className: "rowClassName",
- fixed:'left',
- render: (text, record, index) => {
- return (
-
{ title }
\r\n{ desc }
\r\n 查看源码 \r\n\r\n { code }
\r\n
\r\n {!!scss_code ?\r\n { scss_code }
\r\n
: null }\r\n