PDA

View Full Version : How to hide a radiobutton again?



marxan
6 Jul 2010, 6:51 AM
I'm trying to hide a radio button after it has been displayed. The thing is that I don't know how to retrieve the id's of the fields that just have been displayed when I click on another button. See pictures on attachment. A short picture is better than a long explanation. (first picture start bottom then top right and finally top left)


Below the code I use.

If anyone knows an example that could help me, it's also welcome.



Ext.onReady(function(){
Ext.layout.FormLayout.prototype.trackLabels = true;
function displayRelatedFlows(ID,size){
for(var i=1; i<=size; i++)
{
Ext.getCmp(ID+'-'+i).show();
}

}

Ext.QuickTips.init();

var radioGroup = [{
bodyStyle: 'padding-right:5px;',
items: {
xtype: 'fieldset',
title: 'Select the workflow to monitor',
autoHeight: true,
columns: 1,
vertical: true,
defaultType:'radio',
items: [
<cfset i = 1>
<cfloop collection=#FlowList# item="flowtype">
{xtype: 'label', text: 'Select the #flowType#'},

<cfset u = 1 >
<cfloop list="#StructFind(FlowList, flowtype)#" index="j" >
<cfset nbOfFlows = ArrayLen(MonitoringInstance.getFlowsByProgram('#j#')) />

{boxLabel: '#j#',
id: '#j#',
name: 'flowGroup',
listeners: {check: function(){ displayRelatedFlows('#j#','#nbOfFlows#'); }},
inputValue: '#j#'}<cfif u neq listLen(StructFind(FlowList, flowtype)) || i neq structCount(FlowList)>, </cfif>
<cfset u = u + 1>
</cfloop>
<cfset i = i + 1 >
</cfloop>
]
}
}, {
bodyStyle: 'padding-left:5px;',
items: {
xtype: 'container',
autoHeight: true,
vertical: true,
columns: 1,
defaultType:'radio',
border: false,
items: [
<cfset i = 1>
<cfloop collection=#FlowList# item="flowtype">
<cfset u = 1 >
<cfloop list="#StructFind(FlowList, flowtype)#" index="j" >
<cfset FlowsByPgm = MonitoringInstance.getFlowsByProgram('#j#') />
<cfset r = 1 >
<cfloop array="#FlowsByPgm#" index="k" >
{boxLabel: '#FlowsByPgm[r].xmlAttributes.display#',
name: 'rb-custwidth',
hidden:true,
id: '#j#-#r#',
inputValue: '#r#'}<cfif (u neq listLen(StructFind(FlowList, flowtype)) || (i neq structCount(FlowList)) || r neq arraylen(FlowsByPgm))>, </cfif>
<cfset r = r + 1>
</cfloop>
<cfset u = u + 1>
</cfloop>
<cfset i = i + 1 >
</cfloop>
]
}
}];

var fp = new Ext.FormPanel({

frame: true,
labelWidth: 110,
width: 1000,
renderTo:'form-ct',
bodyStyle: 'padding:0 10px 0;',
items: [
{layout: 'column',
border: false,
defaults: {
columnWidth: '.5',
border: false
},
items: [radioGroup]
}
]
});
});212902129121292