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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.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
Sencha touch Sencha Touch嵌套列表getDetailCard故障_Sencha Touch_Extjs - Fatal编程技术网

Sencha touch Sencha Touch嵌套列表getDetailCard故障

Sencha touch Sencha Touch嵌套列表getDetailCard故障,sencha-touch,extjs,Sencha Touch,Extjs,我在使用嵌套列表和详细信息卡时遇到了一些问题。我目前有一个嵌套列表,显示CD类别的简单树。看起来是这样的: LCMobile.views.CategoriesList = Ext.extend(Ext.Panel, { layout: 'card', items: categoriesList }); var categoriesList = new Ext.NestedList({ title: 'Categories', store: catego

我在使用嵌套列表和详细信息卡时遇到了一些问题。我目前有一个嵌套列表,显示CD类别的简单树。看起来是这样的:

LCMobile.views.CategoriesList = Ext.extend(Ext.Panel, { 
    layout: 'card', 
    items: categoriesList 
}); 

var categoriesList = new Ext.NestedList({ 
    title: 'Categories',
    store: categoryStore, 
    displayField: 'title', 
    getDetailCard: function(item, parent) { 
        var itemData = item.attributes.record.data; 
        parentData = parent.attributes.record.data; 
        LCMobile.detailCard.update(itemData); 
        this.backButton.setText(parentData.title); 
        return LCMobile.detailCard; 
    } 
});  
LCMobile.detailCard = new Ext.Panel({ 
    id: 'detailPanel', 
    layout: 'card', 
    scroll: 'vertical', 
    styleHtmlContent: true, 
    items: '', 
    tpl: ["<h3>{title}</h3>", "<img height='50px' width='50px' src='/images/covers/{sku}.jpg'>{description}" ] 
});  
我的详细信息卡如下所示:

LCMobile.views.CategoriesList = Ext.extend(Ext.Panel, { 
    layout: 'card', 
    items: categoriesList 
}); 

var categoriesList = new Ext.NestedList({ 
    title: 'Categories',
    store: categoryStore, 
    displayField: 'title', 
    getDetailCard: function(item, parent) { 
        var itemData = item.attributes.record.data; 
        parentData = parent.attributes.record.data; 
        LCMobile.detailCard.update(itemData); 
        this.backButton.setText(parentData.title); 
        return LCMobile.detailCard; 
    } 
});  
LCMobile.detailCard = new Ext.Panel({ 
    id: 'detailPanel', 
    layout: 'card', 
    scroll: 'vertical', 
    styleHtmlContent: true, 
    items: '', 
    tpl: ["<h3>{title}</h3>", "<img height='50px' width='50px' src='/images/covers/{sku}.jpg'>{description}" ] 
});  
我遇到的问题是,detailCard将显示一次,back按钮将工作,但它只工作一次,然后出错。说 未捕获的TypeError:无法读取未定义的属性“style”。
我很确定还有一个步骤我没有分配上一张卡,但我有点不知所措,在API中我唯一能找到的是关于卡的prev方法,这只会让我更加困惑。谁能给我指出正确的方向吗?谢谢

虽然我不清楚错误,但我希望您只创建一次LCMobile.detailCard。如果尝试创建另一个具有相同id的面板,则可能会出现问题。这是什么。backButton?NestedList会自动创建这些按钮。