Skip to Content
0

Get Parent element DOM

Jan 23, 2017 at 09:16 PM

68

avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

VIPLOVE KHUSHALANI Jan 24, 2017 at 06:04 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Jan 24, 2017 at 08:55 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded