[#94,transform][m]: rework transform functionality and integration extensively (+ its working again!).
* view.transform.js: major refactor * general record transform rather than column transform * Normal dataset view rather than modal * Reworked UI * split out css from grid.css and simplify * model.js + backend.memory.js: transform implemented on Dataset and Memory (Dataset passes off to _store). * multiview: use new transform view * _includes/recline-deps - rework to use source files rather than built ones
This commit is contained in:
14
src/model.js
14
src/model.js
@@ -149,6 +149,20 @@ my.Dataset = Backbone.Model.extend({
|
||||
return this._store.save(this._changes, this.toJSON());
|
||||
},
|
||||
|
||||
transform: function(editFunc) {
|
||||
var self = this;
|
||||
if (!this._store.transform) {
|
||||
alert('Transform is not supported with this backend: ' + this.get('backend'));
|
||||
return;
|
||||
}
|
||||
this.trigger('recline:flash', {message: "Updating all visible docs. This could take a while...", persist: true, loader: true});
|
||||
this._store.transform(editFunc).done(function() {
|
||||
// reload data as records have changed
|
||||
self.query();
|
||||
self.trigger('recline:flash', {message: "Records updated successfully"});
|
||||
});
|
||||
},
|
||||
|
||||
// ### query
|
||||
//
|
||||
// AJAX method with promise API to get records from the backend.
|
||||
|
||||
Reference in New Issue
Block a user