PDA

View Full Version : How to configure Multiselector anchor?



saadkhan
6 Mar 2010, 2:46 AM
Hello,
I have a multiselector configured and placed inside a window. I want be fully sized as much as window is being inside it iwth padding of 15px.
Here is my code, I have everything but this anchor thingy. Please let me know about it:



var addServiceWindow = new Ext.Window({
title: 'Add Service',
width: 450,
minWidth: 450,
layout: 'anchor',
bodyStyle: 'padding:15px',
modal: true,
items:
[
new Ext.form.FormPanel({
id: 'addServiceWindowFormPanel',
header: false,
// baseCls: 'x-plain',
bodyStyle: 'padding:15px',
api:
{
submit: Autotrack.Remote.addService
},
items:
[
{
fieldLabel: 'Service Name',
name: 'addServiceWindowServiceName',
id: 'addServiceWindowServiceName',
xtype: 'textfield',
anchor: '100%'
},
{
id: 'addServiceWindowPackage',
xtype: 'multiselect',
name: 'addServiceWindowPackage',
anchor: '100%', // <------- Not working
store: packageComboboxStore,
valueField: 'PackageId',
displayField: 'PackageName',
idProperty: 'PackageId',
tbar:
[
{
text: 'clear',
handler: function(){
Ext.getCmp('addServiceWindowPackages').reset();
}
}
]
}
]
})
],
bbar: new Ext.ux.StatusBar(
{
items:
[
{
text: 'Add',
handler: function()
{
var serviceName = Ext.getCmp('addServiceWindowServiceName').getValue();
var packageId = [];
packageId = Ext.getCmp('addServiceWindowPackage').getValue().split(',');
Autotrack.Remote.addService(serviceName,packageId, function(data, trans){
if(data == true)
{
Ext.MessageBox.alert('Service Added Successfully', serviceName + ' Has Been Added To The Selected Package(s).');
}
else
{
Ext.MessageBox.alert('Error', serviceName + ' Could Not Be Added To The Selected Package(s). Samed Named Service May Exist Already.');
}
});
addServiceWindow.close();
}
},
{
text: 'Cancel',
handler: function() {
addServiceWindow.close();
}
}
]
})
});