MyPage.Views.Content = Backbone.View.extend({
loadPage: function() {
//populate jquery grid
}
addUserPhoto:function(){
//open jquery ui modal form where user can
//upload image.
}
})
关闭时的jquery ui对话框
$('#dialog').html('');
$('#dialog').dialog('close');
我想在jquery ui对话框关闭时调用loadPage
函数。我试过这个
addUserPhoto:function(){
//open jquery ui modal form where user can
//upload image.
//close dialog
this.loadPage();
}
但是没有调用loadPage
函数。
答案 0 :(得分:1)
根据documentation,您可以在实例化对话框插件时为close
事件指定回调。
addUserPhoto:function(){
var self = this;
// Specify a callback for the dialog close event
// when you instantiate the plug-in
$('#dialog').dialog({
close: function(event, ui) {
// Load page on dialog close
self.loadPage();
}
});
}