Commit 2a45b833 by Thanaporn Rattanaburi

Updated : funtion get set form

1 parent 19ce8925
Showing with 16 additions and 2 deletions
......@@ -3,7 +3,7 @@ import moment from 'moment'
import 'antd/dist/antd.css'
import './resources/css/wdsSearchStyle.css'
import { Form, Input, Button, Icon, Select, Row, Col, DatePicker } from 'antd'
import * as UrlConstants from '../../../resources/js/constants/UrlConstants'
import * as EventConstants from '../../../resources/js/constants/EventConstants'
const { RangePicker } = DatePicker
const { Option } = Select
......@@ -29,12 +29,26 @@ class WDSSearch extends Component {
return current && current < moment().subtract(30, 'days')
}
// ex ['username','action']
getField = fieldsArray => {
return this.props.form.getFieldsValue(fieldsArray)
}
getFrom = () => {
return this.props.form.getFieldsValue()
}
// ex { screen: 'test' , action: 'xxx'}
setFrom = fieldsArray => {
return this.props.form.setFieldsValue(fieldsArray)
}
_handleSubmitFn = e => {
e.preventDefault()
this.props.form.validateFields((err, values) => {
if (!err) {
console.log('Transaction Search values of form: ', values)
this.props.eventEmitter.emit(UrlConstants.SEARCH_LOGS, values)
this.props.eventEmitter.emit(EventConstants.SEARCH_LOGS, values)
}
})
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!