添加表格日期操作

This commit is contained in:
zhanghy7 2017-09-25 11:18:46 +08:00
parent 269e6f19de
commit a79ebbd41c
3 changed files with 39 additions and 1 deletions

View File

@ -10,6 +10,9 @@
@import "../node_modules/bee-checkbox/src/Checkbox.scss";
@import "../node_modules/bee-select/src/Select.scss";
//引入日期控件样式文件
@import "../node_modules/bee-datepicker/src/datepicker.scss";
.editable-cell {
position: relative;
}

View File

@ -16,6 +16,15 @@ import Select from 'bee-select';
import Popconfirm from "bee-popconfirm";
import InputRender from "../../src/render/InputRender.js";
//日期控件引入
import DatePicker from 'bee-datepicker';
import zhCN from 'rc-calendar/lib/locale/zh_CN';
import enUS from 'rc-calendar/lib/locale/en_US';
const format = 'YYYY-MM-DD';
const dateInputPlaceholder = '选择日期';
class Demo15 extends React.Component {
constructor(props) {
super(props);
@ -94,6 +103,23 @@ class Demo15 extends React.Component {
);
}
},
{ title: '日期', dataIndex: 'datepicker', key: 'datepicker', width: 200,
render:()=>{
return(
<DatePicker
format={format}
onSelect={this.onSelect}
onChange={this.onChange}
locale={zhCN}
placeholder = {dateInputPlaceholder}>
</DatePicker>
)
}
},
{
title: "操作",
dataIndex: "operation",
@ -157,6 +183,15 @@ class Demo15 extends React.Component {
</Animate>
);
};
onSelect = (d) =>{
console.log(d)
};
onChange = (d) => {
console.log(d)
};
render() {
const { dataSource } = this.state;
const columns = this.columns;

File diff suppressed because one or more lines are too long