emberjs/ember.js — Issue #434: How to flush view each time before bind new values?
Author: Princa
Created: 2012-01-25 05:36:57+00:00
State: open

I am creating a drop down list to provide a selection value and each time I change the selected value, it will go and return json back from a web service, then I bind the JSON to the view, I could add the result, but how could I setup to flush the view first and rebind the new values? I guess the two way bind would do it magic...

here is some code:

ET.selectedEmailTypesController = Ember.Object.create({
emailType: null,
isChanged: function () {
if (this.emailType != null) {
LoadETByAppYearETTypeID(ET.selectedAppYearController.appYear.text, this.emailType.email_template_type_id);
}
} .observes('emailType')
});

ET.emailView = Ember.View.extend ({
contentBinding: 'ET.selectedEmailTypesController.emailType'
});

Any thoughts? Thanks!