jquery ui 改写cloes事件

htmlAjax:{//模板ajax请求参数设置项
            url:"template/task/task_create.html",
            dataType:"html"
        },
  isNotHTML:true,
  showBeforeFormatHTML: function(tempalte){
   return tempalte;
  },
  
showAfter:function(data,tempalte){
    var $createTaskArea=$('<div id="createTaskArea"></div>');
    $createTaskArea.append(tempalte)
  
   this.creatNewTaskDialog($createTaskArea);
   this.initUserId();
   this.initPullDownList(); 
   this.bindEventsForTask();
},

/*弹出新建任务窗口*/
creatNewTaskDialog: function(tpl){
   var self = this;
      $(tpl).dialog({
     dialogClass: "task-dialog task-new-dialog", 
     modal: true,
     height: 600,
     width:630,
     title:"新建任务",
     buttons: [
     {
       text: "保存",
       click: function(e) {
       e.stopPropagation();
       var that = $(this);
       self.successCreateTask(that);
       return false;
         }
     },
     {
       text: "取消",
       click: function(e) {
       e.stopPropagation();
       $( this ).dialog("close");
         }
     }
       ],
    "close" : function() {
     $(this).off().remove();
    }
   }); 
}

 

posted @ 2014-08-30 14:51  hlp鹏  阅读(206)  评论(0编辑  收藏  举报