Results 1 to 8 of 8

Thread: Howto clear the style field of an element?

  1. #1

    Default Howto clear the style field of an element?

    Hi,

    I used my-element.position("absolute", null, x, y), which creates an inline style="position: absolute; left: 942px; top: 537px;" for example.

    How do I completely reverse this, so that the inline style == "" ?

    Thanks
    Joerg

  2. #2

  3. #3
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

  4. #4

    Default

    I've tries the clearPositioning, but it then replaces my inline style with "positioning: static", whereas I want it to be "".

  5. #5

    Default

    And my_element.setStyle("") or my_element.setStyle({}) leaves the inline style untouched ...

    my_element.dom.style = "" doesn't work 'cos it's only a getter.

    Are there any other ways?

    Thanks
    Joerg

  6. #6

    Default

    my_element.applyStyles("") also doesn't clear the inline style - it just leaves it untouched .... :-(

  7. #7
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Of course. You are not telling it what styles to set. It can't know.

  8. #8

    Default

    Hmm ... ok.

    So basically to set my inline style to "", I need to first know what's in it, and then clear each style individually, like this:

    my_element.applyStyles({ position:'', left:'', top:'' });

    That undoes what my_element.position() created ...



    Cool - thanks :-)

    Joerg

Posting Permissions

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