@@ -56,6 +56,10 @@ class Body extends Component {
5656 textareaRef : null ,
5757 readOnlyRef : null ,
5858 readOnly : false ,
59+ customInputRef : null ,
60+ customInput : false ,
61+ minusMenuRef : null ,
62+ minusMenu : false ,
5963 } ;
6064 // Bind
6165 this . onFullyUpdate = this . onFullyUpdate . bind ( this ) ;
@@ -67,6 +71,10 @@ class Body extends Component {
6771 this . handleChangeReadOnly = this . handleChangeReadOnly . bind ( this ) ;
6872 this . handleClearGlobalUpdateString = this . handleClearGlobalUpdateString . bind ( this ) ;
6973 this . handleClearDeltaUpdateString = this . handleClearDeltaUpdateString . bind ( this ) ;
74+ this . refCustomInputCheckbox = this . refCustomInputCheckbox . bind ( this ) ;
75+ this . handleChangeCustomInput = this . handleChangeCustomInput . bind ( this ) ;
76+ this . refMinusMenuCheckbox = this . refMinusMenuCheckbox . bind ( this ) ;
77+ this . handleChangeMinusMenu = this . handleChangeMinusMenu . bind ( this ) ;
7078 }
7179
7280 onFullyUpdate ( newJson ) {
@@ -89,6 +97,30 @@ class Body extends Component {
8997 this . state . readOnlyRef = node ;
9098 }
9199
100+ refMinusMenuCheckbox ( node ) {
101+ this . state . minusMenuRef = node ;
102+ }
103+
104+ handleChangeMinusMenu ( ) {
105+ const { minusMenuRef } = this . state ;
106+
107+ this . setState ( {
108+ minusMenu : minusMenuRef . checked ,
109+ } ) ;
110+ }
111+
112+ refCustomInputCheckbox ( node ) {
113+ this . state . customInputRef = node ;
114+ }
115+
116+ handleChangeCustomInput ( ) {
117+ const { customInputRef } = this . state ;
118+
119+ this . setState ( {
120+ customInput : customInputRef . checked ,
121+ } ) ;
122+ }
123+
92124 handleSubmit ( ) {
93125 const { textareaRef } = this . state ;
94126 // Get data
@@ -134,7 +166,7 @@ class Body extends Component {
134166 }
135167
136168 render ( ) {
137- const { json, deltaUpdateString, globalUpdateString, readOnly } = this . state ;
169+ const { json, deltaUpdateString, globalUpdateString, readOnly, customInput , minusMenu } = this . state ;
138170
139171 const style1 = {
140172 width : '100%' ,
@@ -150,14 +182,38 @@ class Body extends Component {
150182 margin : '0 15px' ,
151183 minWidth : '200px' ,
152184 } ;
185+ const style5 = {
186+ backgroundColor : 'black' ,
187+ color : 'yellow' ,
188+ border : '1px solid green' ,
189+ } ;
190+ const customInputElement = customInput ? < input style = { style5 } /> : undefined ;
191+ const minusMenuElement = minusMenu ? < button > Remove</ button > : undefined ;
192+
153193 return (
154194 < div >
155195 < div style = { style4 } >
156- < input
157- type = "checkbox"
158- ref = { this . refReadOnlyCheckbox }
159- onChange = { this . handleChangeReadOnly }
160- /> Read Only
196+ < span >
197+ < input
198+ type = "checkbox"
199+ ref = { this . refReadOnlyCheckbox }
200+ onChange = { this . handleChangeReadOnly }
201+ /> Read Only
202+ </ span >
203+ < span >
204+ < input
205+ type = "checkbox"
206+ ref = { this . refCustomInputCheckbox }
207+ onChange = { this . handleChangeCustomInput }
208+ /> Custom input
209+ </ span >
210+ < span >
211+ < input
212+ type = "checkbox"
213+ ref = { this . refMinusMenuCheckbox }
214+ onChange = { this . handleChangeMinusMenu }
215+ /> Custom minus menu
216+ </ span >
161217 </ div >
162218 < table style = { style1 } >
163219 < thead >
@@ -189,6 +245,8 @@ class Body extends Component {
189245 onFullyUpdate = { this . onFullyUpdate }
190246 onDeltaUpdate = { this . onDeltaUpdate }
191247 readOnly = { readOnly }
248+ inputElement = { customInputElement }
249+ minusMenuElement = { minusMenuElement }
192250 />
193251 </ div >
194252 </ td >
0 commit comments