PDA

View Full Version : adding left padding to button



naikgk
19 Oct 2010, 12:53 AM
how can I add left padding to button. please find attach image and code below.
-------------------------------------------------------------------------------

// JScript File
Application.CacheForm = Ext.extend(Ext.form.FormPanel,
{
border:false ,initComponent:function()
{

/////// config start
var jetnexus = new Ext.data.SimpleStore({
fields: ['id', 'Protocol'],
data : [['1','--not Cached'],['2','Images']]
});
var jetnexus1 = new Ext.data.SimpleStore({
fields: ['id', 'Protocol1'],
data : [['1','Include'],['2','Exclude']]
});
var jetnexus2 = new Ext.data.SimpleStore({
fields: ['id', 'Protocol2'],
data : [['1','directory'],['2','file'],['3','anything starting'],['4','anything ending'],['4','anything containing'],['5','exact match'],['6','All JPEG Images'],['7','All GIF Images'],['8','All Bitmap Images'],['9','All PNG Images'],['10','All HTML Pages']]
});
var config = {
layout:'form',
frame:'true',
url: '../Submit.htm<#SessionID>',
width: 590,
bodyStyle:'padding:25px',
defaults: {width: 230},
labelWidth: 300,
labelAlign:'right',
defaultType: 'textfield',
items: [{
fieldLabel: 'Maximum Cache Size (MB)',
name: 'MCS',
allowBlank:true,
xtype:'textfield',
value: '',
anchor:'90%'

},{
fieldLabel: 'Desired Cache Size (MB)',
name: 'MCS',
allowBlank:true,
inputType:'password',
xtype:'textfield',
value: 'fdsdfsdf',
anchor:'90%'
},{
fieldLabel: 'Default Caching Time (D/HH:MM)',
name: 'MCS',
allowBlank:true,
xtype:'textfield',
value: '',
anchor:'90%'

},{
fieldLabel: 'Cachable HTTP Response Codes',
name: 'MCS',
allowBlank:true,
xtype:'textfield',
value: '',
anchor:'90%'

},{
fieldLabel: 'Cache Checking Timer (D/HH:MM)',
name: 'MCS',
allowBlank:true,
xtype:'textfield',
value: '',
anchor:'90%'

},{
fieldLabel: 'Cache-Fill Count',
name: 'MCS',
allowBlank:true,
xtype:'textfield',
value: '',
anchor:'90%'

},{
xtype:'label',
html:'<hr/>',
width:'89.5%'
},{

xtype:'tbbutton',
text:'Update',
width:'60',
name:'update_time',
style:'margin-left:415;margin-bottom:30',
formBind:true,
scope:this,
handler: this.submit

},{

xtype:'tbbutton',
fieldLabel: 'Force a check on the cache size now',
text:'Check Cache',
width:'85',
name:'update_time',
//style:'margin-left:415;margin-bottom:30',
formBind:true,
scope:this,
handler: this.submit

},{

xtype:'tbbutton',
labelWidth: 320,
fieldLabel: 'Remove all items from the cache to restart caching',
text:'Clear Cache',
width:'85',
name:'update_time',
style:'margin-bottom:10',
formBind:true,
scope:this,
handler: this.submit

},{
xtype:'label',
html:'<hr/>',
style:'margin-bottom:20',
width:'89.5%'
},{
fieldLabel: 'Cache-Fill Count',
name: 'MCS',
allowBlank:true,
xtype:'textfield',
value: '',
anchor:'90%'
},{
xtype: 'combo',
name: 'genre',
displayField:'Protocol',
mode: 'local',
store: jetnexus ,
anchor:'90%'
},{
xtype:'label',
width:'100%',
style:'margin-left:168',
formBind:true,
html: '<br /><br /><b>Other Domains Served</b>'
},{
fieldLabel: 'Domains Name',
name: 'MCS',
allowBlank:true,
xtype:'textfield',
value: '',
style:'margin-bottom:10',
anchor:'90%'
},{
xtype:'label',
html:'<hr/>',
width:'89.5%'
},{

xtype:'tbbutton',
text:'Update',
width:'60',
name:'update_time',
style:'margin-left:415;margin-bottom:20',
formBind:true,
scope:this,
handler: this.submit
},{
xtype:'label',
width:'100%',
style:'margin-left:98',
formBind:true,
html: '<b>Cache Content Selection Rulebases</b>'
},{
fieldLabel: 'Name',
name: 'MCS',
allowBlank:true,
xtype:'textfield',
value: '',
anchor:'90%'
},{
fieldLabel: 'Description',
name: 'MCS',
allowBlank:true,
xtype:'textfield',
value: '',
anchor:'90%'
},
{
xtype: 'combo',
name: 'genre',
displayField:'Protocol1',
mode: 'local',
store: jetnexus1 ,
anchor:'90%'
},{
xtype: 'combo',
name: 'genre',
displayField:'Protocol2',
mode: 'local',
store: jetnexus2 ,
anchor:'90%'
}
]};
Ext.apply(this, Ext.apply(this.initialConfig, config));
// });

Application.CacheForm.superclass.initComponent.apply(this, arguments);

} // eo function initComponent

,onRender:function()
{
// this.store.load();
Application.CacheForm.superclass.onRender.apply(this, arguments);

} // eo function onRender


,submit:function()
{
this.getForm().submit
(
{
standardSubmit: true,
url : this.url,
success : this.onSuccess,
failure : this.onFailure
}
);
}
,onSuccess:function(form, action)
{
Ext.MessageBox.alert("Success","Form Submitted SuccessFully");
}

,onFailure:function(form, action)
{
Ext.MessageBox.alert("Failure","Form could not be Submitted.");
}

});

Ext.reg('Cache', Application.CacheForm);