내 백본보기에는 클릭하면 새보기가 생성되고 Kendo 창에서 해당보기가 열리는 이벤트 Popout이 있습니다. 내가 원하는 것은 버튼을 클릭하면이 뷰 내의 이벤트가 바인딩 해제되고 Kendo Window에서 새 뷰를 사용할 수 있다는 것입니다. 다음으로 Kendo Window를 닫으면 이벤트가 리 바인딩되기를 원합니다. 그러나 이것에 대한 오류가 발생합니다.
Uncaught TypeError : Object [object Object]에 'delegateEvents'메소드가 없습니다. Kendo 창 닫기 기능에 대한 이벤트를 어떻게 리 바인드 할 수 있습니까?
popout: function(){
this.stopListening();
//this.delegateEvents();
this.undelegateEvents();
var model = this.model;
var popOutModuleView = new PopOutModuleView({model:model});
lightRegion.show(popOutModuleView);
Backbone.trigger("popout");
event.preventDefault();
var a = $('#lightbox').kendoWindow({
actions: ["Maximize", "Close"],
title: name,
width: "90%",
height: "90%",
resizable: true,
close: function(e){
popOutModuleView.remove();
lightRegion.close();
this.delegateEvents();
}
});
"this"는 Backbone.View를 참조하지 않으므로 delegateEvents ()를 알 수 없습니다. 이것을 닫기 함수에 바인딩하거나 닫기 함수 범위에서 사용할 수 있도록해야합니다.
popout: function() {
var _this = this;
// CODE
var a = $('#lightbox').kendoWindow({
// CODE
close: function() {
_this.delegateEvents();
}
});
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다