PDA

View Full Version : list.store.filter and Segmented Button setPressed



imwill
15 Sep 2011, 4:13 AM
I've got three SegmentedButtons and a List which are docked and added to a Panel.




this.sb = new Ext.SegmentedButton({
defaults:{
xtype:'button',
scope:this,
flex: 1
},
width: '90%',
items:[
{id:'20/09/2012',text:'20.09.', index: 0, dateData: '20/09/2012', handler: this.changeDate},
{id:'21/09/2012',text:'21.09.', index: 1, dateData: '21/09/2012', handler: this.changeDate},
{id:'22/09/2012',text:'22.09.', index: 2, dateData: '22/09/2012', handler: this.changeDate},
],
cls:'day-selector'
});


In the beginning I tried to filter my list data which worked quite good:



changeDate: function(btn) {
this.list.store.clearFilter();
this.list.store.filter('date', btn.dateData);
this.list.scroller.scrollTo({y: 0}, false);
}




Now I would like to set the pressed button at index 0. This works when I load the page for the first time but when I switch between the buttons it doesn't display the list. When I try to scroll the list area it gives me an error "Uncaught TypeError: Cannot read property 'offset' of undefined":



checkActiveDate: function(){
if (this.sb) {
this.sb.setPressed(this.startDateIndex);
this.changeDate(this.sb.items.getAt(this.startDateIndex));
}
}


I already tried to add a this.doComponentLayout(); to my checkActiveDate function but it didn't to the trick.
Any ideas how I could fix this? :-?

marcelsnews
3 Oct 2011, 12:42 PM
Hey i'm facing the same problem

Did you find a solution ? i'm still working on it without no success :-(

thanks.