From: Gil Moskowitz Date: Mon, 14 Jul 2014 15:06:32 +0000 (-0400) Subject: disable export button if gridbox data have been changed X-Git-Tag: v4.6.0-beta~17^2~2 X-Git-Url: http://git.roojs.org/?a=commitdiff_plain;h=f15399f94f943d99ccce8e8fb51710de245a78e6;p=xtuple disable export button if gridbox data have been changed --- diff --git a/lib/enyo-x/source/views/grid_box.js b/lib/enyo-x/source/views/grid_box.js index 7f264d766..7383e2934 100644 --- a/lib/enyo-x/source/views/grid_box.js +++ b/lib/enyo-x/source/views/grid_box.js @@ -372,6 +372,10 @@ trailing:true, white:true, strict: false*/ this.inherited(arguments); this.createComponents(this.buildComponents()); }, + allRowsSaved: function () { + return _.every(this.getValue().models, + function (e) { return e.isReadyClean(); }); + }, buttonTapped: function (inSender, inEvent) { var editor = this.$.editableGridRow, model, @@ -537,6 +541,7 @@ trailing:true, white:true, strict: false*/ refreshLists: function () { this.$.aboveGridList.refresh(); this.$.belowGridList.refresh(); + this.$.exportButton.setDisabled(! this.allRowsSaved()); }, reset: function () { this.setEditableIndex(null); @@ -624,6 +629,8 @@ trailing:true, white:true, strict: false*/ if (this.$.summaryPanel) { this.$.summaryPanel.setValue(model); } + + this.$.exportButton.setDisabled(! this.allRowsSaved()); } }); }());