PDA

View Full Version : Reference Tab Specific Slider in a FormPanel



vacalder
21 May 2010, 5:02 AM
Hi.

I was having trouble referencing a slider on a given tab. My current setup is:


var panel = new Ext.form.FormPanel({
itemId: 'panel',
border : false,
bodyStyle: 'padding:5px 5px 5px 5px;',
items: [{
border: false,
xtype: 'slider',
isFormField: true,
hideLabel: true,
itemId : seekBar,
value : 0,
minValue : 0,
maxValue : 0,
plugins : new Ext.SeekTip()
}Now, my tabs contain the same FormPanel so I need to get the ActiveTabs slider so I have the following call:

var slider = Ext.getCmp('tabs').getActiveTab().getComponent('panel').getForm().findField(seekBar);

and I also tried:

var slider = Ext.getCmp('tabs').getActiveTab().getComponent('panel').getComponent(seekBar);

Any suggestions on how to obtain the slider object on the active tab?

Thanks in advance.

vacalder
21 May 2010, 10:41 AM
What I ended up doing was this:



Ext.getCmp('tabs').getActiveTab().getComponent('panel').seekSlider.getValue()

and I set a ref in the class.


{
border: false,
xtype: 'slider',
ref: '../seekSlider',
isFormField: true,
hideLabel: true,
itemId : seekBar,
value : 0,
minValue : 0,
maxValue : 0,
plugins : new Ext.SeekTip()
}