I use ExtJS for a gridview and I now need a search option above the grid. So I created a panel and added the items such as a textbox and two buttons to it. It all works fine except of the layout. I need the textbox and two buttons to be align horizontally instead of vertically. I already tried to inject html elements like styles without any success.
How can I align components horizontal within a container?
var formPanel=Ext.create('Ext.form.Panel', {
title: 'Catalog Search',
width:300,
bodyPadding: 10,
submitOnAction: true,
activeItem: 1,
items: [{
xtype: 'textfield',
name: 'Job Name',
id:'JobName',
fieldLabel: 'Job Name',
allowBlank: false,
}, {
xtype: 'button',
name: 'search',
fieldLabel: 'Catalog Search',
text: 'Search',
html:'style=float:left',
width:100,
listeners:{
click:function(){
var searchText=Ext.getCmp('JobName').getValue();
store.proxy.extraParams={
id: searchText
};
store.load();
}
}
},
{
xtype: 'button',
name: 'clear',
fieldLabel: 'Clear',
text: 'Clear',
width:100,
listeners:{
click:function(){
Ext.getCmp('JobName').reset();
var searchText='';
store.proxy.extraParams={
id: searchText
};
store.load();
}
}
}
]
});
formPanel.render('paging-grid');