File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export default class Cell extends React.Component {
14
14
< select className = "form-control"
15
15
data-column = { data . columnIndex }
16
16
data-row = { data . rowIndex }
17
+ data-select = { JSON . stringify ( value . items ) }
17
18
onChange = { onEdit }
18
19
value = { value . selected } >
19
20
{ value . items . map ( ( item , i ) => < option key = { i } > { item } </ option > ) }
Original file line number Diff line number Diff line change @@ -67,7 +67,15 @@ export default class Index extends Component {
67
67
68
68
const { dataSource} = this . state
69
69
70
- dataSource [ rowIndex ] [ columnIndex ] = fieldValue ;
70
+ if ( target . dataset . select ) {
71
+ dataSource [ rowIndex ] [ columnIndex ] = {
72
+ selected : fieldValue ,
73
+ items : JSON . parse ( target . dataset . select )
74
+ }
75
+ } else {
76
+ dataSource [ rowIndex ] [ columnIndex ] = fieldValue ;
77
+ }
78
+
71
79
72
80
this . setState ( { dataSource} )
73
81
}
You can’t perform that action at this time.
0 commit comments