Results 1 to 5 of 5

Thread: assign cls-class at em-tag outside buttons

  1. #1
    Sencha User
    Join Date
    Sep 2011
    Location
    Berlin
    Posts
    4
    Vote Rating
    0
      0  

    Question 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:
    Code:
    <em class="" unselectable="on">
        <button id="xyz" class=" x-btn-text ui-silk ui-silk-note-go" type="button">Speichern</button>
    </em>
    The css-code is unspectacular:
    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
    }
    But, if there are any ideas, how I can position sprites at left side, this would be a solution.

    I'm sorry for this bad English and thank you in anticipation for your help!

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,416
    Vote Rating
    1269
      0  

    Default

    Code:
        var button = new Ext.Button({
            renderTo : Ext.getBody(),
            text     : 'Hello',
            iconCls  : 'test'
        });
    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)
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Sep 2011
    Location
    Berlin
    Posts
    4
    Vote Rating
    0
      0  

    Default

    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

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Location
    Berlin
    Posts
    4
    Vote Rating
    0
      0  

    Default

    I think, I've to overwrite onRender for buttons and especially this part

    Code:
    if(position){
        btn = this.template.insertBefore(position, targs, true);
    }else{
        btn = this.template.append(ct, targs, true);
    }
    ... but I dont now how.

    Oh: I'm using V. 3.2.1

  5. #5
    Sencha User
    Join Date
    Sep 2011
    Location
    Berlin
    Posts
    4
    Vote Rating
    0
      0  

    Default

    Can anyone give support, Please?
    I couldn't solve this problem...

    Thanks in advance!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •