PDA

View Full Version : Store.filterBy is not a function



aecontrerasl
25 Oct 2010, 12:40 PM
Hi everyone, Im give up trying to figure it out how to solve it, so I have to ask for your help.

Im creating a store that get some json from Yahoo Pipes


// Set up a model to use in our Store
Ext.regModel('noticias', {
fields: [
'title',
'description',
'guid', {fields: [
'isPermaLink',
'content'
]}
]
});

// Store
var almacenDatos = new Ext.data.Store({
id: 'almacenDatos',
model: 'noticias',
sorters: 'title',
getGroupString : function(record) {
return record.get('title');
}
});


//////////////////////////////////////////////////////////////////////
// Linea de tiempo (items)
//////////////////////////////////////////////////////////////////////
var timeline = new Ext.List({
id:'lineaTiempo',
title: 'principal',
loadingText: 'Loading content...',
//cls: 'timeline',
itemSelector: 'div.item',
scroll: 'vertical',
height: '150',
tpl: [
'<tpl for=".">',
'<div id="{guid.content}" class="item">',
'<div class="avatar"><img src="http://t0.gstatic.com/images?q=tbn:8les3TA_p6TIEM:b" /> </div>',
'<div class="item-content">',
'<h2>{title}</h2>',
'<p>{description}<br />',
'</div>',
'</div>',
'</tpl>'
],
singleSelect: true,
store: almacenDatos
});





Then, Im calling for data



//////////////////////////////////////////////////////////////////////
// Data Source:
//////////////////////////////////////////////////////////////////////


Ext.util.JSONP.request({

url: 'http://pipes.yahoo.com/pipes/pipe.run',
callbackKey: '_callback',
params: {
_id: '32423423411231',
_render: 'json',
_callback: '?'

},
callback: function(data) {

data = data.value.items;


// We update the Store
timeline.store.loadData(data,false);

Ext.getBody().unmask();

}
});


Everything is fine until now, but...



//////////////////////////////////////////////////////////////////////
// Timeline Actions
//////////////////////////////////////////////////////////////////////
timeline.on('itemtap',function(dv, index, item, evento){


// WE FILTER THE STORE
almacenDatos.filterBy(function(record, id){

return false;

});



});


When I click some item in the timeline, I get the following error:

almacenDatos.filterBy is not a function

And I don't know why, because the store is fine and working, because I can see the items.


Please give me some help.

Thanks in advance.

aecontrerasl
27 Oct 2010, 10:27 AM
Anyone? I wonder this could be a bug, because all other functions works.