Skip to Content
avatar image
Former Member

Get Parent element DOM

Hi Friends,

I want to change "sapUiRespGridSpanL6" to "sapUiRespGridSpanL12" in the DIV at runtime. Is this possible. I can change it in the debugger (chrome) and it works. The problem is, it has no ID, so I have to look of the parent of the Label LFPM_CARRID.

Thanks in advance.

Rg. Joerg

bgvdy.png (56.1 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 24, 2017 at 06:04 AM

    Hi Joerg ,

    Actually its not good to change the class like this (by changing the class on DOM level though javascript) but still if you want to than you can get the parent element like this

    var parent = document.getElementById("LFPM-CARRID").parentNode // this will give you div element

    var cName = parent.className // give you the value of class property of div in string format.

    thanks

    Viplove

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 24, 2017 at 08:55 AM

    Thanks Viplove,

    you are right. The problem is, I use sap.ui.layout.Grid and need a different number of elements in the rows. But I can only set one combination as default like L12 M12 S12. But sometimes I need only one element and I have to set colspan. But for my impression this is not possible.

    Rg. Joerg

    Add comment
    10|10000 characters needed characters exceeded