PDA

View Full Version : Grid Tbar - Right Alignment



renganathan
30 Jun 2012, 1:32 AM
Hi ,

I have two items in the tool bar . first item aligned in left and second item also aligned in left.

but i want second item to be aligned in right

i tried various ways , but it didn't work

can somebody help me how to fix this problem?

36676





tbar :
[
{
text : '<b align="left">Search Result</b>',
style :
{
align : 'left'
}
},
{
text :'<b align="right">If lab not found, click here to sync</b>',
iconCls :'sync',
titleAlign : 'right',
style :
{
align : 'right'
},
handler : function ()
{
Ext.getBody().mask('Processing...please wait');
Ext.Ajax.request(
{
url : '../src/profile_user.class.php',
params:
{
action:'syncLabs'
},
success: function(response)
{
Ext.getBody().unmask();
var resultDevice= eval('(' + response.responseText + ')');
if(resultDevice == 1)
{
// show success message if profile saved successfily
Ext.Msg.alert('Success', 'Synced Successfully!');
}
Ext.getCmp('firstGrid').getStore().load();

},
//show alert if ajax request fails
failure: function(response)
{
Ext.getBody().unmask();
Ext.MessageBox.alert('Failed','Sync Failed');
}
});
}
}


]

sword-it
30 Jun 2012, 2:27 AM
Hi renganathan,

No need to give style config for left / right alignment of component in tbar config. use '->' for example-



tbar:[
{
xtype:'button',
text:'left'
},'->',
{
xtype:'button',
text:'right'
}
],



For more information see http://docs.sencha.com/ext-js/4-1/#!/api/Ext.toolbar.Toolbar