-
30 Jun 2012 1:32 AM #1
Answered: Grid Tbar - Right Alignment
Answered: Grid Tbar - Right Alignment
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?
align right.png
Code: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'); } }); } } ]
-
Best Answer Posted by sword-it
Hi renganathan,
No need to give style config for left / right alignment of component in tbar config. use '->' for example-
For more information see http://docs.sencha.com/ext-js/4-1/#!...oolbar.ToolbarCode:tbar:[ { xtype:'button', text:'left' },'->', { xtype:'button', text:'right' } ],
-
30 Jun 2012 2:27 AM #2Sencha - Community Support Team
- Join Date
- May 2012
- Location
- Istanbul
- Posts
- 1,331
- Vote Rating
- 76
- Answers
- 124
put '->' before your component to give alignment right
put '->' before your component to give alignment right
Hi renganathan,
No need to give style config for left / right alignment of component in tbar config. use '->' for example-
For more information see http://docs.sencha.com/ext-js/4-1/#!...oolbar.ToolbarCode:tbar:[ { xtype:'button', text:'left' },'->', { xtype:'button', text:'right' } ],sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.


Reply With Quote