Hello,
Can anyone tell me how to do it dynamically? Thanks.
Original:
Code:
var itemArray = new Array();
itemArray[0] = new Ext.Panel({
title: 'Accordion Item 1',
html: '<empty panel>',
cls:'empty'
});
itemArray[1] = new Ext.Panel({
title: 'Accordion Item 2',
html: '<empty panel>',
cls:'empty'
});
itemArray[2] = new Ext.Panel({
title: 'Accordion Item 3',
html: '<empty panel>',
cls:'empty'
});
itemArray[3] = new Ext.Panel({
title: 'Accordion Item 4',
html: '<empty panel>',
cls:'empty'
});
var accordion = new Ext.Panel({
region:'west',
margins:'5 0 5 5',
split:true,
width: 210,
layout:'accordion',
items: [itemArray[0], itemArray[1], itemArray[2], itemArray[3]]
});
The numbers of item in 'itemArray' is varied. I would like to code dynamically like this.
Code:
var accordion = new Ext.Panel({
region:'west',
margins:'5 0 5 5',
split:true,
width: 210,
layout:'accordion',
items: [itemArray]
});
Error prompts for 'header' is null or not an object. Any idea or solution?
Thanks for your help.
Regards,
GM