sap.m.CustomListItem 上的事件“按”不起作用
Event "press" on sap.m.CustomListItem doesn't work
sap.m.CustomListItem 的 dokumentation 说 CustomListItem 会press
事件。
新闻事件位于列表项内的按钮上。按钮工作正常。单击列表项不显示任何内容。甚至没有错误。
var oCustomItem = new sap.m.CustomListItem({
content: [
new sap.m.Text({
text: "{text}"}),
new sap.m.Button({
text: "btn",
press: function(){
alert("Pressed the button");
}
})
],
press: function(){
alert("Clicked the list item");
}
});
下面是一个示例:http://jsbin.com/pozeve/4/edit?html,output
这是用户在使用列表控件时经常遇到的问题。这里有一个答案。
简而言之,您必须在CustomListItem
中添加一个type
属性:
var oCustomItem = new sap.m.CustomListItem({
content: [
new sap.m.Text({
text: "{text}"}),
new sap.m.Button({
text: "btn",
press: function(){
alert("Pressed the button");
}
})
],
type : sap.m.ListType.Active,
press: function(){
alert("Clicked the list item");
}
});
或mode
您的sap.m.List
财产。有关比较,请参阅上面提到的答案。
相关文章:
- JsFiddle上的鼠标事件不起作用
- 在IE8中不起作用的元素上触发单击事件
- 链接上的IE10 jquery句柄单击事件不起作用
- Javascript点击事件回调不起作用
- jQuery加载完成事件不起作用
- 覆盖单击事件不起作用
- 鼠标事件在OpenLaszlo应用程序中不起作用
- 单击事件不起作用
- 插入后单击锚点标记上的事件after不起作用
- 为什么body元素上的onclick事件不起作用
- 追加Jquery后的Binding Click事件不起作用
- chrome中的onmouseover(下拉选项标记)事件不起作用-php,javascript
- 添加事件侦听器不起作用
- onclick事件在asp.net上不起作用
- jQuery调用keyup事件不起作用
- 单击事件在jquery easyui多选项卡中不起作用
- jQuery ContextMenu事件在IOS 8.2中不起作用
- 第二个事件[onClick]不起作用
- 按键事件上的简单HTML输入不起作用
- Keyup事件在easyui上不起作用