Ignore:
Timestamp:
03/09/14 19:25:40 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • _ComplexValueMixin propagates priorityChange to children.
  • Deserialize updated docs after save too.
  • Validate to false if definitions are missing.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/pages/surveyRun.js

    r492 r493  
    2222        templateString: template,
    2323        classStore: surveyRuns,
     24        _isValid: false,
    2425        startup: function() {
    2526            if ( this._started ) { return; }
     
    3031        _refresh: function() {
    3132            this.titleNode.innerHTML = this.object.title || "";
    32             this.surveySummaryWidget.set('value',this.object.survey);
    33             this.surveyRunWidget.set('value',this.object);
     33            this.surveySummaryWidget.set('value',this.object.survey,null);
     34            this.surveyRunWidget.set('value',this.object,null);
    3435            this._refreshURL();
    3536            this._loadResponses();
     
    9697        },
    9798        _updateObject: function() {
    98             var valid = this.surveyRunWidget.validate();
    99             if ( valid ) {
     99            this._isValid = this.surveyRunWidget.validate();
     100            if ( this._isValid ) {
    100101                lang.mixin(this.object,this.surveyRunWidget.get('value'));
    101102            }
    102             return valid;
     103            return this._isValid;
    103104        },
    104105        _onSave: function(evt) {
     
    122123        },
    123124        markDirty: function() {
    124             this.saveBtn.set('disabled',false);
    125             this.saveAndCloseBtn.set('disabled',false);
     125            this.saveBtn.set('disabled',!this._isValid);
     126            this.saveAndCloseBtn.set('disabled',!this._isValid);
    126127            this.discardBtn.set('label','Discard & Close');
    127128            this.inherited(arguments);
Note: See TracChangeset for help on using the changeset viewer.