Last active
December 29, 2015 04:09
-
-
Save mauritslamers/7612980 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
GX.itemController = SC.ObjectController.create({ | |
invoiceVatBinding: 'GX.invoiceForItemController.hasVAT', | |
hasVAT: function(){ | |
return this.get('invoiceVat'); | |
}.property('invoiceVat') | |
}); | |
GX.invoiceForItemController = SC.ObjectController.create({ | |
contentBinding: "GX.itemController.invoice" | |
}); | |
//=== | |
GX.Item = SC.Record.extend({ | |
invoice: SC.Record.toOne("GX.Invoice", { inverse: "item" }), | |
invoiceDidChange: function () { | |
this.notifyPropertyChange('invoice'); | |
}.observes('invoiceHasVAT'), | |
invoiceHasVAT: function() { | |
return this.getPath('invoice.hasVAT'); | |
}.property('invoice').cacheable(), // replacing this by .property('invoice.hasVAT').cacheable() and removing the observer above also throw an error | |
... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment