Remove ScrollBars on GlideDialogForm

jeremyeperdue
Giga Expert

How can I remove the vertical scroll bars on a GlideDialogForm?

1 ACCEPTED SOLUTION

Venkat and others that helped,



I think we will live with the scroll bars. I was really hoping for something like .removeCloseDecoration()



ServiceNow advises against DOM Manipulation and after a few issues caused by the changes in Geneva (like labels going to legends), I am reluctant to pursue this. Also, this is for an integration. So when the integration upgrade happens we may see issues or they may have addressed this.


Thank you,


Jeremy


View solution in original post

11 REPLIES 11

Srinivas Balusu
Kilo Guru

Hi,


          I hope below thread can give you some idea.


How to add a scroll bar in glidedialogwindow


rakesh_ravi
ServiceNow Employee
ServiceNow Employee

The reason for scroll bars to appear might be your larger content size which is not fitting into the default height.


Can you try setting height on the GlideDialog.



In case you still have problem, can you paste your code/screenshot here.



Hope this helps.


I have statically set the height, finally. It was setting the scroll bar at half of the page below. Anyway, not that I have it set, I have the field below Additional Information with a setDisplay false, NOT a setVisible false.



example_1.PNG


Once someone clicks Add Recipients, another window appears and the user can make a selection and the Recipients field appears once populated.



example_2.PNG


As you can see, it has pushed the UI Actions off the bottom of the screen.


venkatiyer1
Giga Guru

Hi Jeremy,



If you want to remove scroll bar it could lead to clipping of content. If it is a dynamic content you might want to calculate the scroll height and scroll width property of the dialog window and add it to the innerHeight and innerWidth property of Dialog window.



But if you want to still make the overflow hidden, then this code should help




Parameters to be replaced


dialog title, your table name and sys id.




var dd = new GlideDialogForm("dialog title", "your table name");
dd.setSysID("sys id");


dd.setLoadCallback(function(){
$j("#dialog_frame").contents().find(".touch_scroll").filter(".section_header_content_no_scroll").css("overflow", "hidden");
})
dd.render();



I am sure you are already having most of the lines from above to render, what you need is the setloadcallbak to modify the overflow propery.



Just by setting the overflow property of dialog doesnt hide the scroll dom manipulation is required as above.