I am building one simple task application in which I can add new status. Scenario is I have already build the status dashboard using predefined array of objects by calling can.Model findAll method. View is stored in 'dashboard.ejs'. As I create new status, I persist that data into my array of objects and in the save callback new array data (including new one comes up). Now my question is how to refresh my current view with the new returned data
controller=new can.Control({
init:function(element,options)
{
var frag=can.view('dashboard.ejs',this.options)
this.element.html(frag);
},
'someButton click':function(el,ev)
{
new ModelCall(formObject).save(function(response)
{
//response contains added new object
//how to refresh the dashboard.ejs with the new response
});
}
})
Do I need to create object of new controller again for this purpose or I am missing something?