Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/455.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
Javascript 如何使用sencha touch2在AccordionList上进行文本实时搜索_Javascript_Extjs_Sencha Touch_Sencha Touch 2_Accordion - Fatal编程技术网

Javascript 如何使用sencha touch2在AccordionList上进行文本实时搜索

Javascript 如何使用sencha touch2在AccordionList上进行文本实时搜索,javascript,extjs,sencha-touch,sencha-touch-2,accordion,Javascript,Extjs,Sencha Touch,Sencha Touch 2,Accordion,我已经通过这个演示实现了AccordionList 12。它工作得很好。根据要求需要现场搜索手风琴列表上的文字。我只需要搜索手风琴列表标题中的文本,而不需要搜索子节点中的文本。在搜索之后,一旦获得手风琴头,应该能够展开和折叠这些头。我已尝试使用此链接。它的工作非常好的列表,但对于手风琴列表,我尝试了不正常的工作,它的行为不同。它正在从显示可用标题的标题中搜索,但我无法展开标题,因为这些标题下没有子节点。最初,对于那些标题,搜索文本后有子节点。没有子节点,仅显示标题。有人能告诉我如何在手风琴列表中

我已经通过这个演示实现了AccordionList 12。它工作得很好。根据要求需要现场搜索手风琴列表上的文字。我只需要搜索手风琴列表标题中的文本,而不需要搜索子节点中的文本。在搜索之后,一旦获得手风琴头,应该能够展开和折叠这些头。我已尝试使用此链接。它的工作非常好的列表,但对于手风琴列表,我尝试了不正常的工作,它的行为不同。它正在从显示可用标题的标题中搜索,但我无法展开标题,因为这些标题下没有子节点。最初,对于那些标题,搜索文本后有子节点。没有子节点,仅显示标题。有人能告诉我如何在手风琴列表中实现这一点吗?非常感谢。多谢各位

代码如下:

将此存储值分配给手风琴列表代码如下所示

 if(searchfield !== ""){
     store.filter([{
     property: "text",
     value: searchfield,
     anyMatch: true
     //exactMatch:true
    }]);
}
else{
    store.clearFilter();
}
var accordionlistContent = {
                                xtype: 'accordionlist',
                                //store: Ext.create('eGMonitorApp.store.TestsStore'),
                                store: store,
                                name: 'accordionList',
                                height: 500,
                                headerItemTpl: [
                                    '<tpl if="this.isExpanded(values)">',
                                    '<div class="testsstatus{status}"></div></div>',
                                    '<div style="width:80%;margin-left: 10px" <tpl if="values.year">style="font-style:italic; "</tpl>>',
                                    '{text}</div>',
                                    '<div class="down"></div>',
                                    '<tpl else>',
                                    '<div class="testsstatus{status}"></div></div>',
                                    '<div style="width:80%;margin-left: 10px"<tpl if="values.year">style="font-style:italic;"</tpl>>',
                                    '{text}</div>',
                                    '<div class="right"></div>',
                                    '</tpl>'
                                ].join(''),
                                contentItemTpl: [
                                    '<div class="testsstatus{status}"></div></div>',
                                    '<div style="margin-left: 10px" >{text}<div>'
                                ].join(''),
                                useSelectedHighlights: false,
                                indent: true
                            }