Hybrid View
-
30 Sep 2010 3:26 AM #1
Referencing some items each other
Referencing some items each other
Hi everyone!
I've got 2 items in a FormPanel. First one is a radiogroup, second one is an Extended TabPanel.
I'm trying to modify some properties of the TabPanel depending the value of the radiogroup.
I've been thinking about it and i've coded this:
And trying to handle the value of 'ro' in my extended tabPanelFianzas.Code:var f = new Ext.FormPanel({ ... items:[{ ... },{ xtype: 'radiogroup', hideLabel: true, itemCls: 'x-check-group-alt', vertical: true, name: 'ro', columns: 1, items:[{ ... }] },{ ... },{ xtype: 'tabPanelFianzas', radio: f.getForm().findfield('ro') },{ ... }]
Is it anyway to do it? is it the correct way? I'm tring to avoid the use of Ext.getCmp().
f is undefined like that, and i've been trying with "this" and is window.document.
Thanks in advance!People won't be people when they hear this sound, that's been glowing in the dark, at the edge of town. People won't be people, no, the people won't be people when they hear this sound. Won't you show me what begins at the edge of town. The singer is a crook Woah-ay-oh! The kitchen is the cook Woah-ay-oh! The scissors are the barbers Woah-ay-oh! The singer is a crook Woah-ay-oh! The chorus, full of actors Woah-ay-oh! The chorus doesn't matter!
-
30 Sep 2010 5:30 AM #2
Your form (f) is not rendered when your code trying affect f.getForm()... to property 'radio'
PHP Code:{
xtype: 'tabPanelFianzas',
getRadio: function () {
var radio = Ext.getCmp('myFormId').getForm().findfield('ro');
return function () {
return radio;
}
}
}
-
30 Sep 2010 5:38 AM #3
Oh! Thanks! i get it.
Now, is there any way to change some properties of the extended TabPanel if i handle the radiogroup without changing the radiogroup code?
Thanks!!People won't be people when they hear this sound, that's been glowing in the dark, at the edge of town. People won't be people, no, the people won't be people when they hear this sound. Won't you show me what begins at the edge of town. The singer is a crook Woah-ay-oh! The kitchen is the cook Woah-ay-oh! The scissors are the barbers Woah-ay-oh! The singer is a crook Woah-ay-oh! The chorus, full of actors Woah-ay-oh! The chorus doesn't matter!
-
30 Sep 2010 5:48 AM #4
but it will be more easiest to start with radiogroupPHP Code:{
xtype: 'tabPanelFianzas',
getRadio: function () {
var radio = Ext.getCmp('myFormId').getForm().findfield('ro');
return function () {
return radio;
}
},
listeners: {
render: function (cmp) {
var radio = cmp.getRadio();
radio.on('change', function (radioGroup,radioChecked) {
if(....) {
cmp.hide(); // cmp is your tabPanelFianzas
}
else {
cmp.show();
}
};
}
}
}
PHP Code:{
xtype: 'radiogroup',
hideLabel: true,
itemCls: 'x-check-group-alt',
vertical: true,
name: 'ro',
columns: 1,
items:[{
...
}],
listeners: {
change: function (radioGroup, radioChecked) {
var tabpanel = Ext.getCmp('myTabPanelFianzas');
if(....) {
tabpanel.hide();
}
else {
tabpanel.show();
}
}
}
}
..
{
xtype: 'tabPanelFianzas',
id: 'myTabPanelFianzas'
}
-
30 Sep 2010 6:01 AM #5
Yeah! I'm really close to the solution!!
Thank you so much!!People won't be people when they hear this sound, that's been glowing in the dark, at the edge of town. People won't be people, no, the people won't be people when they hear this sound. Won't you show me what begins at the edge of town. The singer is a crook Woah-ay-oh! The kitchen is the cook Woah-ay-oh! The scissors are the barbers Woah-ay-oh! The singer is a crook Woah-ay-oh! The chorus, full of actors Woah-ay-oh! The chorus doesn't matter!
Similar Threads
-
Referencing components in containers
By dlipski in forum Ext 3.x: Help & DiscussionReplies: 0Last Post: 13 Nov 2009, 7:41 AM -
[FIXED][3.0.0] Referencing child items when extending a container.
By elishnevsky in forum Ext 3.x: BugsReplies: 2Last Post: 7 Aug 2009, 4:46 PM -
Referencing Form Elements
By iwarner in forum Ext 2.x: Help & DiscussionReplies: 3Last Post: 29 Apr 2009, 2:16 AM -
Referencing form items
By Efex in forum Ext 2.x: Help & DiscussionReplies: 0Last Post: 27 May 2008, 4:24 PM


Reply With Quote