PDA

View Full Version : DataReader - CRUD "create" action



vxviper
12 Dec 2010, 2:49 PM
The DataReader's realize method is not merging the server-returned data with the already in-place record data, even though according to old releases and the current doc:

"data from server will be merged with the data in the local record. In addition, you must return record-data from the server in the same order received."

Now, the way I see it, it should either be configurable or kept in override mode. Just force the developer to re-form the entire record and send it back is unacceptable.

Grim post-apocalyptic reality (3.3):



rs.id = this.getId(data);
rs.data = data; // <---

rs.commit();


Lost paradise (3.1.1):



rs.id = this.getId(data);

rs.fields.each(function(f) {
if (data[f.name] !== f.defaultValue) {
rs.data[f.name] = data[f.name];
}
});
rs.commit();