This is a migrated thread and some comments may be shown as answers.

Border styles and scrollbar

2 Answers 157 Views
Splitter
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 12 Jun 2013, 02:59 PM
I've customized the look of the splitter a bit to match some UI mockups I am designing against. I've avoided margin/border/padding on k-pane elements at all costs. However, I am revisiting the issue and am wondering if anyone has any tips to correct the current problem I'm facing.

Currently, I draw the borders and apply margin to an element within the k-pane. The best I can make things look is this: http://i.imgur.com/LUvaJff.png 

I want the border outside the scrollbar. But I also want the scrollbar to be generated by the splitter and not defined by an element nested inside of it. Like this: http://i.imgur.com/PkpyfMe.png

Help/tips are appreciated.

2 Answers, 1 is accepted

Sort by
0
Ryan
Top achievements
Rank 1
answered on 12 Jun 2013, 06:44 PM
Have been working on this for a bit. I have to apply the border to the k-pane because that's where k-scrollable is placed and the border must surround that. My layout is splitter1 -> pane -> splitter2 -> pane. I do not think it is feasible to put an additional element between the splitter2 and the pane.

So, attached is the current look. It does what I want it to except that the borders push the layout horizontally and vertically (as expected) and the overflow is clipped. Is there somewhere I could put some margin or padding to bring these clipped borders back within view?  Or is there a different approach?

Thanks
0
Dimo
Telerik team
answered on 14 Jun 2013, 10:56 AM
Hi Ryan,

The Splitter panes should not have margins, paddings and borders. This is a requirement by design, which ensures faster and easier size calculations and layout adjustment.

Adding elements in the DOM hierarchy between the Splitter element and the Pane elements will not produce the desired result, because the Splitter expects the children of its wrapper element to be pane elements, so it will simply change the pane elements.

In your case I can suggest you to disable pane scrolling and use scrollable <div>s as children of the panes. Since these <div>s will have borders (and possibly paddings), then simply setting 100% height will lead to content overflow. You will have to calculate their heights in each Splitter's layoutChange event. All Splitter panes have width and height set at all times, which will make your task easier.

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Splitter
Asked by
Ryan
Top achievements
Rank 1
Answers by
Ryan
Top achievements
Rank 1
Dimo
Telerik team
Share this question
or