ttk-app-core
Version:
enterprise develop framework
47 lines (42 loc) • 1.26 kB
JavaScript
import {GridDecorator} from 'edf-component'
function getGridOption() {
return {
'details': {
path: 'data.form.details',
selectFieldName: 'selected',
cellClassName: 'app-pu-arrival-card-cell',
emptyRow: {},
getColNames: (gf) => {
return [
'proceedsType',//0
'depdepartment',//1
'project',//
'amount',//3
'quantity',//4
]
},
cellIsReadonly: (cellPosition, path, gf) => {
if (cellPosition.x == 1
|| cellPosition.x == 2
|| cellPosition.x == 3
|| cellPosition.x == 9)
return true
return false
}
},
}
}
function actionCreator(option) {
return {
gridAction: new GridDecorator.action({ ...option, gridOption: getGridOption() })
}
}
function reducerCreator(option) {
return {
gridReducer: new GridDecorator.reducer({ ...option, gridOption: getGridOption() })
}
}
export default {
actionCreator,
reducerCreator
}