Javascript 从jquery ui模式表单调用主干视图函数

Javascript 从jquery ui模式表单调用主干视图函数,javascript,jquery,jquery-ui,backbone.js,jquery-ui-dialog,Javascript,Jquery,Jquery Ui,Backbone.js,Jquery Ui Dialog,关闭jquery ui对话框 MyPage.Views.Content = Backbone.View.extend({ loadPage: function() { //populate jquery grid } addUserPhoto:function(){ //open jquery ui modal form where user can //upload image. } }) 我想在jquer

关闭jquery ui对话框

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对话框关闭时调用
loadPage
函数。我试过这个

$('#dialog').html('');
$('#dialog').dialog('close');
但是它没有调用
loadPage
函数。

根据,可以在实例化对话框插件时为
close
事件指定回调

addUserPhoto:function(){
    //open jquery ui modal form where user can 
    //upload image. 

    //close dialog
    this.loadPage();
}
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();
        }
    });
}