Created
January 31, 2013 10:53
-
-
Save bobey/4682095 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.TableAlias = DS.Model.extend({ | |
name: DS.attr('string'), | |
alias: DS.attr('string'), | |
// ... | |
environment: null, | |
columns: [], | |
_loadColumns: function() { | |
var environment = this.get('environment'); | |
if (!environment) { | |
// Si pas d'environnement sélectionné pas la peine de tenter de récupérer les colonnes... | |
return; | |
} | |
this.set('columns', App.Column.findByAlias(this, environment)); | |
}, | |
environmentDidChanged: function() { | |
this._loadColumns(); | |
}.observes('environment'), | |
didLoad: function() { | |
this._loadColumns(); | |
}, | |
didUpdate: function() { | |
this._loadColumns(); | |
} | |
// ... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment