Skip to Content
avatar image
Former Member

How to remove padding created by ResponsiveGridLayout?

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-control-in-openui5-sapui5

Thanks,

Radu

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 20, 2015 at 12:09 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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.

  • Oct 19, 2015 at 11:23 PM

    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

      }});

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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