-
14 Nov 2011 11:07 AM #1
assign cls-class at em-tag outside buttons
assign cls-class at em-tag outside buttons
I would use sprites for icons. But on using iconCls there is a positioning problem:
The icon does'nt stayes at left side. Text covers it.
So I would use <em> tag:
The css-code is unspectacular:Code:<em class="" unselectable="on"> <button id="xyz" class=" x-btn-text ui-silk ui-silk-note-go" type="button">Speichern</button> </em>
But, if there are any ideas, how I can position sprites at left side, this would be a solution.Code:button.ui-silk{ width : 16px !important; height : 16px !important; background : transparent url(/pics-VT/silk-sprite.png) !important; background-repeat : no-repeat !important; } .ui-silk-note-go{ background-position : -336px -0px !important }
I'm sorry for this bad English and thank you in anticipation for your help!
-
14 Nov 2011 1:16 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,641
- Vote Rating
- 434
Will add 18px to the left and you should place your image int he background of the button tag and have it only 16px by 16px (for each sprite)Code:var button = new Ext.Button({ renderTo : Ext.getBody(), text : 'Hello', iconCls : 'test' });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
14 Nov 2011 1:45 PM #3
The iconCls works perfect with single images. But I want to use sprites.
The effect will show this screenshot: position.png
The background-image is positioned behind the text.
The padding-left:18px is unchanged...
Hope, this better can explain my question.
Thank you for your quick reply
-
15 Nov 2011 1:54 AM #4
I think, I've to overwrite onRender for buttons and especially this part
... but I dont now how.Code:if(position){ btn = this.template.insertBefore(position, targs, true); }else{ btn = this.template.append(ct, targs, true); }
Oh: I'm using V. 3.2.1
-
16 Nov 2011 2:29 PM #5
Can anyone give support, Please?
I couldn't solve this problem...
Thanks in advance!


Reply With Quote