我将 html 添加到 Sencha 列表行,onClick 在 Windows 上的 Chrome 和 Safari 上运行良好,但点击事件在 iPad 上不起作用。请让我知道在 iPad 上制作示例的任何建议。
Sencha Fiddle 示例: http ://www.senchafiddle.com/#MadlC#SPOJb#psFLV
代码:
var store = Ext.create('Ext.data.Store', {
fields: ['htmlRow'],
autoLoad: true,
});
store.add([{ "htmlRow": "<div onclick='func_click1();' style='background:gray;width:70px;float:left'>Click 1</div><div onclick='func_click2()' style='background:yellow;width:70px;float:left'>Click 2</div>" }]);
store.add([{ "htmlRow": "Edt"}]);
store.add([{ "htmlRow": "Jamie"}]);
store.add([{ "htmlRow": "Aaron"}]);
store.add([{ "htmlRow": "Dave"}]);
store.add([{ "htmlRow": "Michael"}]);
store.add([{ "htmlRow": "Abraham"}]);
store.add([{ "htmlRow": "Jay"}]);
//define the application
Ext.application({
launch: function() {
Ext.Viewport.add({
width: '100%',
height: '100%',
centered: true,
hideOnMaskTap: false,
layout: 'fit',
items: [{
xtype: 'list',
disableSelection:true,
itemTpl: '<strong>{htmlRow}</strong>',
store: store
}]
});
}
});
function func_click1(){
alert("Why This Click 1 Working on Safari and Google Chrome in Windows, But Not Working on Ipad !");
}
function func_click2(){
alert("Why This Click 2 Working on Safari and Google Chrome in Windows, But Not Working on Ipad !");
}