PDA

View Full Version : Adding drop down (combo box) in panel header



Soumya Maharana
28 Oct 2012, 10:47 PM
Hi All,
I have a panel. I want to add a drop down to its header. I am following MVC architecture. I searched the forum regarding this concern and was able to find one. But that wasn't in MVC. When I try to add the same code in MVC it doesn't work.

Regards

Soumya

skirtle
29 Oct 2012, 2:30 AM
Why does using the MVC affect it? Could you post your code?

desp
29 Oct 2012, 2:54 AM
Sorry, but I did not understand a single bit, but I think, you need just create single view for that combobox and create your own xtype with
alias: 'mynewxtype' in view itself. So, in main layout defining aka Viewport.js you just add this item and you won't break any MVC rule I guess.

Soumya Maharana
29 Oct 2012, 4:14 AM
initComponent: function () {
this.header.add({
xtype: 'combobox',
text: 'Test',
align: 'left'
});
this.store = 'Home.UnreadAlertStore';
this.columns = [
{
text : 'Company',
flex : 1,
sortable : false,
dataIndex: 'company'

},
{
text : 'Price',
width : 75,
sortable : true,
renderer : 'usMoney',
dataIndex: 'price'

},
{
text : 'Change',
width : 75,
sortable : true,
renderer : change,
dataIndex: 'change'

},
{
text : '% Change',
width : 75,
sortable : true,
renderer : pctChange,
dataIndex: 'pctChange'

},
{
text : 'Last Updated',
width : 85,
sortable : true,
renderer : Ext.util.Format.dateRenderer('m/d/Y'),
dataIndex: 'lastChange'

}


?
];
this.callParent(arguments);
}







Here is the sample code that i am using to display a dropdown in the Grid Header.


this.header.add({
xtype: 'combobox',
text: 'Test',
align: 'left'

}); // with MVC



grid.header.add({
xtype: 'combobox',
labelWidth: 35,
fieldLabel: 'Test'

}) // without MVC


I want to display the Dropdown with the field name as Test just beside the Grid title "Array Grid" as shown in the attachment using MVC.

nagalla038
29 Oct 2012, 4:21 AM
Even im facing the same issue. Any suggestions will be appreciated.