首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Sencha触觉2: IE上不针对div的项目点击

Sencha触觉2: IE上不针对div的项目点击
EN

Stack Overflow用户
提问于 2015-07-14 11:19:28
回答 1查看 158关注 0票数 8

我正在开发一个Cordova混合应用程序,目前在Windows8.1上使用Sencha Touch 2,我得到了一些div和一些子元素。我定义了一个监听程序。这在Android和IOS上都很好,但在的Win8.1上却不起作用。我总是得到上面说谎的语言元素,而不是点击的div容器。

这是一个简化的例子:

意见:

代码语言:javascript
运行
复制
Ext.define( 'App.view.MyDataView', {

xtype: 'mydataview',
extend:  Ext.dataview.List ,

config: {

    inline: false,
    title: "myTitle",

    scrollToTopOnRefresh: false,

    cls: 'MyDataView',
    itemCls: 'MyDataViewItem',
    pressedCls: 'MyDataViewItemPressed',
    grouped: true,

    listeners: {
        tap: {
            element: 'element',
            //delegate: '.something',

            fn: function (e)
            {
                console.log(e.target.className)
            }
        }
    },
    deferEmptyText: false,
    infinite: true,

    variableHeights: true,
    itemTpl: new Ext.XTemplate(
        [

                            '<div class="red" style="background-color:red;width:50%">',
                'red',
                '<div class="black" style="background-color:black;width:80%">',
                    '<div class="blue" style="background-color:blue;width:30%">blue</div>',
                'black</div>',
            '</div>'
        ].join( '' ),
        {
            compiled: true,
            getInteractable: function() {},
            //some member functions here...

        }
    )
}
});

e.target的点击侦听器总是给我以下信息:

代码语言:javascript
运行
复制
<div class="x-unsized x-list-item WorkingHoursDataViewItem x-has-height x-list-item-tpl" id="ext-simplelistitem-85" style="height: 42px !important; min-height: 42px !important; transform: translate3d(0px, 264px, 0px);">
  <div class="x-unsized x-list-disclosure x-item-hidden" id="ext-component-233" style="display: none !important;"></div>
  <div class="x-innerhtml" id="ext-element-815">
        <div class="red" style="width: 50%; background-color: red;">
              red
           <div class="black" style="width: 80%; background-color:black;">
               <div class="blue" style="width: 30%; background-color:blue;">
                          blue
                          </div>
                     </div>
                    black
                  </div>
             </div>
              </div>
           </div>
        </div>
     </div>
  </div>

我浏览了许多事件e,目标,但没有引用单击的div容器:/

提前感谢!

//编辑:简化示例//它与分组:true ->相关,如果我注释掉这一切都按预期工作

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-21 11:19:53

修正了它-如果分组:真被设置,它会在IE上造成这个意想不到的结果。

解决办法:显示视图后: list.updateGrouped()

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31405136

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档