[#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:
Rufus Pollock
2012-06-28 23:52:58 +01:00
parent c2f5debf1f
commit aa1a362bb2
10 changed files with 153 additions and 226 deletions

View File

@@ -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.