Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Select Sencha Touch:[未定义]不是一个函数_Select_Extjs_Sencha Touch_Element - Fatal编程技术网

Select Sencha Touch:[未定义]不是一个函数

Select Sencha Touch:[未定义]不是一个函数,select,extjs,sencha-touch,element,Select,Extjs,Sencha Touch,Element,我正在尝试使用senchatouch按类名获取元素 itemswipe: function(dataview, index, element, e) { console.log(element.select('.x-list-disclosure')); } 但它返回以下错误: TypeError:表达式“element.select”[undefined]的结果不是函数 这是完整的代码块 var list1 = new Ext.List({ flex: 1, cls:

我正在尝试使用senchatouch按类名获取元素

itemswipe: function(dataview, index, element, e) {
    console.log(element.select('.x-list-disclosure'));
}
但它返回以下错误:

TypeError:表达式“element.select”[undefined]的结果不是函数

这是完整的代码块

var list1 = new Ext.List({
    flex: 1,
    cls: 'list_simple',
    sorters: ['firstName', 'group'],
    itemTpl: '{firstName} {lastName}',
    grouped: true,
    groupTpl : [
        '<tpl for=".">',
            '<div class="x-list-group x-group-{id}">',
                '<h3 class="x-list-header"><div class="header">{group}</div></h3>',
                '<div class="x-list-group-items">',
                    '{items}',
                '</div>',
            '</div>',
        '</tpl>'
    ],
    onItemDisclosure: function(record, btn, index) {
        Ext.Msg.alert('Tap', 'Disclose more info for ' + record.get('firstName') + ' ' + record.get('lastName'), Ext.emptyFn);
    },
    listeners: {
        itemtap: function(dataview, index, element, e) {
            console.log('node is tapped');
        },
        itemswipe: function(dataview, index, element, e) {
            console.log(element.select('.x-list-disclosure'));
        }
    },
    store: store
});

有什么想法吗?

通过调用Ext.fly来包装元素变量,它将为您提供dom元素的Ext.element表示形式。元素变量是DOM节点,而不是Ext.element实例。因此它变成了Ext.fly(element)。select(“..”

看起来像是您试图获取.x-list-discoverage,但您在显示给我们的代码中没有它。它是自动生成的元素。如果执行
console.log(元素)
,则会得到预期的结果。我想知道lib是否损坏了,但我不这么认为.x-list-item类在
items内滑动
listener?htmldevelment。我在问题中添加了生成的item元素。通过调用Ext.fly包装元素变量,它将为您提供dom元素的Ext.element表示。元素变量是DOM节点,而不是Ext.element实例。因此它变成Ext.fly(element)
<div class="x-list-group-items">
    <div class="x-list-item x-item">
        <div class="x-list-item-body">Melvin Gilbert</div>
        <div class="x-list-disclosure"></div>
    </div>
    <div class="x-list-item x-item">
        <div class="x-list-item-body">Jeaffrey Gilbert</div>
        <div class="x-list-disclosure"></div>
    </div>
</div>