@@ -118,38 +118,56 @@ export default class BrowserTable extends React.Component {
118
118
let editCloneRows = null ;
119
119
if ( this . props . editCloneRows ) {
120
120
editCloneRows = (
121
- < div style = { { marginBottom : 30 , borderBottom : '1px solid #169CEE' } } >
121
+ < div >
122
122
{ this . props . editCloneRows . map ( ( cloneRow , idx ) => {
123
123
let index = ( this . props . editCloneRows . length + 1 ) * - 1 + idx ;
124
124
const currentCol = this . props . current && this . props . current . row === index ? this . props . current . col : undefined ;
125
125
const isEditingRow = this . props . current && this . props . current . row === index && ! ! this . props . editing ;
126
126
return (
127
- < BrowserRow
128
- key = { index }
129
- isEditing = { isEditingRow }
130
- className = { this . props . className }
131
- columns = { this . props . columns }
132
- schema = { this . props . schema }
133
- simplifiedSchema = { this . props . simplifiedSchema }
134
- filters = { this . props . filters }
135
- currentCol = { currentCol }
136
- isUnique = { this . props . isUnique }
137
- obj = { cloneRow }
138
- onPointerClick = { this . props . onPointerClick }
139
- onFilterChange = { this . props . onFilterChange }
140
- order = { this . props . order }
141
- readOnlyFields = { READ_ONLY }
142
- row = { index }
143
- rowWidth = { rowWidth }
144
- selection = { this . props . selection }
145
- selectRow = { this . props . selectRow }
146
- setCurrent = { this . props . setCurrent }
147
- setEditing = { this . props . setEditing }
148
- setRelation = { this . props . setRelation }
149
- setCopyableValue = { this . props . setCopyableValue }
150
- setContextMenu = { this . props . setContextMenu }
151
- onEditSelectedRow = { this . props . onEditSelectedRow }
152
- />
127
+ < div key = { index } style = { { borderBottom : '1px solid #169CEE' } } >
128
+ < BrowserRow
129
+ key = { index }
130
+ isEditing = { isEditingRow }
131
+ className = { this . props . className }
132
+ columns = { this . props . columns }
133
+ schema = { this . props . schema }
134
+ simplifiedSchema = { this . props . simplifiedSchema }
135
+ filters = { this . props . filters }
136
+ currentCol = { currentCol }
137
+ isUnique = { this . props . isUnique }
138
+ obj = { cloneRow }
139
+ onPointerClick = { this . props . onPointerClick }
140
+ onFilterChange = { this . props . onFilterChange }
141
+ order = { this . props . order }
142
+ readOnlyFields = { READ_ONLY }
143
+ row = { index }
144
+ rowWidth = { rowWidth }
145
+ selection = { this . props . selection }
146
+ selectRow = { this . props . selectRow }
147
+ setCurrent = { this . props . setCurrent }
148
+ setEditing = { this . props . setEditing }
149
+ setRelation = { this . props . setRelation }
150
+ setCopyableValue = { this . props . setCopyableValue }
151
+ setContextMenu = { this . props . setContextMenu }
152
+ onEditSelectedRow = { this . props . onEditSelectedRow }
153
+ />
154
+ < Button
155
+ value = "Clone"
156
+ width = "55px"
157
+ primary = { true }
158
+ onClick = { ( ) => {
159
+ this . props . onSaveEditCloneRow ( index ) ;
160
+ this . props . setEditing ( false ) ;
161
+ } }
162
+ additionalStyles = { { fontSize : '12px' , height : '20px' , lineHeight : '20px' , margin : '5px' , padding : '0' } }
163
+ />
164
+ < Button
165
+ value = "Cancel"
166
+ width = "55px"
167
+ onClick = { ( ) => this . props . onAbortEditCloneRow ( index ) }
168
+ additionalStyles = { { fontSize : '12px' , height : '20px' , lineHeight : '20px' , margin : '5px' , padding : '0' } }
169
+ />
170
+ </ div >
153
171
) ;
154
172
} ) }
155
173
</ div >
@@ -287,13 +305,16 @@ export default class BrowserTable extends React.Component {
287
305
}
288
306
let wrapTop = Math . max ( 0 , this . props . current . row * ROW_HEIGHT ) ;
289
307
if ( this . props . current . row < - 1 && this . props . editCloneRows ) {
290
- wrapTop = ROW_HEIGHT * ( this . props . current . row + ( this . props . editCloneRows . length + 1 ) ) ;
308
+ //for edit clone rows
309
+ wrapTop = ( 2 * ROW_HEIGHT ) * ( this . props . current . row + ( this . props . editCloneRows . length + 1 ) ) ;
291
310
}
292
311
if ( this . props . current . row > - 1 && this . props . newObject ) {
312
+ //for data rows when there's new row
293
313
wrapTop += 60 ;
294
314
}
295
315
if ( this . props . current . row >= - 1 && this . props . editCloneRows ) {
296
- wrapTop += ROW_HEIGHT * ( this . props . editCloneRows . length + 1 ) ;
316
+ //for data rows & new row when there are edit clone rows
317
+ wrapTop += ( ROW_HEIGHT ) * ( this . props . editCloneRows . length + 1 + 1 ) ;
297
318
}
298
319
let wrapLeft = 30 ;
299
320
for ( let i = 0 ; i < this . props . current . col ; i ++ ) {
0 commit comments