@@ -78,7 +78,7 @@ export default class BrowserTable extends React.Component {
78
78
} ) ;
79
79
}
80
80
81
- renderRow ( { row, obj, json , rowWidth } ) {
81
+ renderRow ( { row, obj, rowWidth } ) {
82
82
let attributes = obj . attributes ;
83
83
let index = row - this . state . offset ;
84
84
return (
@@ -103,10 +103,10 @@ export default class BrowserTable extends React.Component {
103
103
attr . targetClassName = this . props . columns [ name ] . targetClass ;
104
104
} else if ( type === 'Array' || type === 'Object' ) {
105
105
// This is needed to avoid unwanted conversions of objects to Parse.Objects.
106
- // When retrieving data from JSON, Parse-SDK will not try to convert any data.
106
+ // "Parse._encoding" is responsible to convert Parse data into raw data.
107
107
// Since array and object are generic types, we want to render them the way
108
108
// they were stored in the database.
109
- attr = json [ name ] ;
109
+ attr = Parse . _encode ( obj . get ( name ) ) ;
110
110
}
111
111
}
112
112
let current = this . props . current && this . props . current . row === row && this . props . current . col === j ;
@@ -176,7 +176,7 @@ export default class BrowserTable extends React.Component {
176
176
for ( let i = this . state . offset ; i < end ; i ++ ) {
177
177
let index = i - this . state . offset ;
178
178
let obj = this . props . data [ i ] ;
179
- rows [ index ] = this . renderRow ( { row : i , obj, json : obj . toJSON ( ) , rowWidth : rowWidth } ) ;
179
+ rows [ index ] = this . renderRow ( { row : i , obj, rowWidth : rowWidth } ) ;
180
180
}
181
181
182
182
if ( this . props . editing ) {
@@ -199,17 +199,13 @@ export default class BrowserTable extends React.Component {
199
199
}
200
200
let obj = this . props . current . row < 0 ? this . props . newObject : this . props . data [ this . props . current . row ] ;
201
201
let value = obj ;
202
- let json = obj . toJSON ( ) ;
203
202
if ( ! this . props . isUnique ) {
204
203
if ( type === 'Array' || type === 'Object' ) {
205
- if ( ! json ) {
206
- json = obj . toJSON ( ) ;
207
- }
208
204
// This is needed to avoid unwanted conversions of objects to Parse.Objects.
209
- // When retrieving data from JSON, Parse-SDK will not try to convert any data.
205
+ // "Parse._encoding" is responsible to convert Parse data into raw data.
210
206
// Since array and object are generic types, we want to edit them the way
211
207
// they were stored in the database.
212
- value = json [ name ] ;
208
+ value = Parse . _encode ( obj . get ( name ) ) ;
213
209
} else {
214
210
value = obj . get ( name ) ;
215
211
}
0 commit comments