cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove padding created by ResponsiveGridLayout?

Former Member
0 Kudos

Hi,

I am trying to use ResponsiveGridLayout control on my form so I can use the 12- grid system which helps me give the input fields the right size. The problem is that ResponsiveGridLayout inserts some padding around the form which is not what I want.Any idea how to remove this padding the OpenUI5 way? (as opposed to Custom CSS).


I have posted code snippets and more details on stackoverflow:


http://stackoverflow.com/questions/33225476/how-to-remove-padding-created-by-responsivegridlayout-co...

Thanks,

Radu

Accepted Solutions (1)

Accepted Solutions (1)

daniel_ruiz2
Active Contributor
0 Kudos

hi Radu,

Custom CSS would probably perform better as you won't need to modify the DOM tree.. any real reason why you don't want to add a style class and override it from there?

Cheers,

Dan.

Former Member
0 Kudos

Hi,

Thanks, I will go ahead with Custom CSS. I was just wondering if there's any straightforward way to do it.

Thanks,

Radu

daniel_ruiz2
Active Contributor
0 Kudos

hi Radu,

Really depends what you want to achieve.. Case you're going to use this everywhere (or many times in your application) you could extend the ResponsiveGridLayout (and the renderer) to re-implement where the main class is being written (Renderer.getMainClass - String) - add your own class there and use a custom css to code the style.

I would only go thru such if you really need to use this many times - this way you won't need to remember to always add a class into the view layout element - but if this is for one element or two I wouldn't even go thru the trouble of extending controls that could always introduce issues when patching to a higher major release.

Cheers,

Dan.

Answers (1)

Answers (1)

former_member182372
Active Contributor
0 Kudos

do you need to remove class from element?

add delegate for after rendering and remove class using jquey

sap.ui.getCore().byId("ID").addDelegate({

   onAfterRendering: function () {

   $("#GLOBAL_ID")//do whaatever is needed

  }});

Former Member
0 Kudos

Thanks, I think it does the job, but I was wondering if there's any way to do it using the OpenUI5 controls/classes rather than adding one more bit of functionality.

Thanks,

Radu