如何检测添加到剑道窗口的视图上的单击或单击事件
how to detect onClick or click event on a view added to kendo window
我有一个剑道窗口弹出窗口,我在触发某些事件时打开它。在该剑道窗口中,我使用window.content(new View().el添加了一个视图。视图包含多个div,其中一个具有 id 左箭头。点击div #leftArrow 我需要做点什么。但是我无法检测到onclick事件。我在视图中添加了单击事件侦听器,并为其提供了一个回调函数。当我单击事件侦听器断点时,事件正在触发,但不知何故没有在视图中侦听它。谁能说出问题出在哪里??
/*This is the controller file where I have created the kendo window and added view in it*/
var window = uiLayer.extWindow({
elem : $('#popUp'),
actions:["Close"],
modal: true,
animation: false,
resizable: true,
close: that.onClose,
width: "95%",
height: "95%",
minHeight : "35%",
minWidth : "60%",
position:{
top:"1%",
left:"1%",
height:"100%",
width:"100%"
}
});
window.open();
window.content(new PopUpScrollLayoutView(this).el);
/*This is the view in which I have added various templates which contain the div #leftArrow . I have added click event in the events and given it a callback method.
*/
PopUpScrollLayoutView = Marionette.LayoutView.extend({
initialize : function(options){
console.log("Initialising EventContentView");
console.log(options.getAllWidgets());
var allWidgets = options.getAllWidgets();
this.render(allWidgets);
},
events: {
"click #leftArrow":"leftArrowClicked"
},
tagName: "div",
className: "scrollContent",
regions : {
leftArrow : "#leftArrow",
mainArea : "#mainArea",
rightArrow : "#rightArrow",
footer : "#footer"
},
render : function(allWidgets){
this.$el.append(template());
this.$el.append(mainAreaTemplate());
this.$el.append(FooterAreaTemplate());
},
leftArrowClicked:function(e){
console.log("Inside left arrow");
}
});
你可以使用 jQuery 来实现这个目的:
$("#leftArrow").click(leftArrowClicked);
相关文章:
- 将单击事件添加到数据表
- 将单击事件添加到附加的项目中
- 在IE8中不起作用的元素上触发单击事件
- 链接上的IE10 jquery句柄单击事件不起作用
- 如何使用纯 JavaScript 在所有浏览器中区分左/右/中键单击事件
- 如何在master中调用细节网格作为单击事件
- 兰吉 |如何在 span 标签上使用单击事件删除突出显示的文本
- 如何隐藏按钮单击事件上的占位符
- 复选框,然后单击事件处理
- 如何使用for循环添加所有按钮'单击事件
- 手柄'img'单击事件并插入'alt'使用jQuery将属性转换为文本框
- 覆盖单击事件不起作用
- 单击事件打开两个弹出菜单
- 单击事件不起作用
- 从其他元素上的单击事件访问image src属性
- 单击事件中的ajax请求后重定向
- 如何缩放地图框传单中的标记单击事件
- 在没有焦点的情况下捕获画布上的第一次单击事件
- 通过单击事件识别画布上的对象
- 如何将单击事件添加到JQuery中动态添加的元素中