在煎茶触摸2

问题描述:

创建搜索到数据视图在数据视图组件,我可以插入一个DataItem的,但如何我做插入搜索+,作为列表中的组件在煎茶触摸2

+0

你是什么'searcher'是什么意思? – 2012-04-16 18:18:52

+0

类似这样:[示例搜索列表](http://dev.sencha.com/deploy/touch/examples/production/list-search/index.html) – sneyder05 2012-04-16 20:11:05

数据视图和列表直接绑定到百货(Ext.data.Store) 。因此,该商店发生的任何事情都会反映在视图中。

所以你需要做的是过滤器的商店。您可以通过在商店上使用filterfilterBy方法来完成此操作。

的更多信息:http://docs.sencha.com/touch/2-0/#!/api/Ext.data.Store-method-filter

var store = Ext.create('Ext.data.Store', { 
    fields: ['text'], 
    data: [ 
     { text: 'one'}, 
     { text: 'two'}, 
     { text: 'three'} 
    ] 
}); 

store.filter('text', 'one'); // will only show the one record