PDA

View Full Version : how to display items section under panel based on condition



vasuk
21 Mar 2012, 5:18 AM
here is my panel and the items section in the panel

{
xtype:'panel',
title: 'Features and Specs Comparision',
frame:true,
bodypadding:10,
width:'905px',
// needs to display based on condition returned from the server
// a complete items section needs to displayed based the value returned from the server
items: [{

}]


}


In the above piece of code I have to display the different items section based on Value returned from the server
for example if(Value ==1 ) {
a different items section
} else if (Value ==2 ) {
a different items section
}

could any body please help me in achieving this

vietits
21 Mar 2012, 5:45 AM
function getColumns(){
if(Value == 1){
return [{
....
}];
} else if(Value == 2) {
return [{
....
}];
}
...
}
...
{
xtype:'panel',
title: 'Features and Specs Comparision',
frame:true,
bodypadding:10,
width:'905px',
// needs to display based on condition returned from the server
// a complete items section needs to displayed based the value returned from the server
items: getColumns()
}

vasuk
21 Mar 2012, 9:03 AM
Thanks a lot it worked