I'm working on a project management form and have a number of tabs. It will break the tabs onto multiple rows. The problem is that labels are wrapped to a second line even though there is enough room to display the label "risk managment" on the first row.
Besides, the active tab (standards) overlaps in such a way that another tab (quality) is not fully visible anymore. How can the visualisation be optimised?
Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
tabs with multiple rows
-
- Posts: 36
- Joined: Sat Jun 02, 2018 1:26 pm
tabs with multiple rows
You do not have the required permissions to view the files attached to this post.
Re: tabs with multiple rows
amit,
You'll need to find another way.
If you put too many fields (even though you are talking about Tabs) on 1 Form the server may not be able to save anything properly because of PHP's ini settings.
Steven
You'll need to find another way.
If you put too many fields (even though you are talking about Tabs) on 1 Form the server may not be able to save anything properly because of PHP's ini settings.
Steven
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: tabs with multiple rows
Hi,
I created a script to turn the tabs into vertical arranged tabs. If you (or anyone is interested) I can publish its source code. Short video:
https://vimeo.com/277757547
I created a script to turn the tabs into vertical arranged tabs. If you (or anyone is interested) I can publish its source code. Short video:
https://vimeo.com/277757547
You do not have the required permissions to view the files attached to this post.
-
- Posts: 36
- Joined: Sat Jun 02, 2018 1:26 pm
Re: tabs with multiple rows
Toms, I'd be very interested to see how you did that and I believe that should fix the display problem.
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: tabs with multiple rows
Here you go:
1. Create a new Object of Type HTML.
Recommended position: Top: 0, Left 0, Width 200, Height 500.
HTML:
2. Add this JS to your form:
You're done. You might want to modify the css colors to match your design, since I use a custom style sheet.
1. Create a new Object of Type HTML.
Recommended position: Top: 0, Left 0, Width 200, Height 500.
HTML:
Code: Select all
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {box-sizing: border-box}
body {font-family: "Segoe UI", Helvetica, "Helvetica Neue", Arial, sans-serif;}
/* Style the tab */
.vtab {
float: left;
width: 30%;
height: 132;
border-right: 1px solid rgba(0, 0, 0, 0.08);
background-color: #FDFDFD;
}
/* Style the buttons inside the tab */
.vtab button {
box-sizing: border-box;
display: inline-block;
position: relative;
text-align: left;
cursor: pointer;
margin: 0 0 3px 0;
height: 25px;
padding: 0px 12px;
background-color: #F4F8F9;
border: 1px solid #ccc;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
outline: none;
white-space: nowrap;
word-wrap: break-word;
text-overflow: ellipsis;
overflow: hidden;
color: #333;
border-color: rgba(0, 0, 0, 0.08);
}
/* Change background color of buttons on hover */
.vtab button:hover {
background-color: #eee;
border-left: 2px solid #c01c00;
}
/* Create an active/current "vtab button" class #e8f3ff */
.vtab button.active {
background-color: #ffffff;;
border-right: none;
border-left: 2px solid #c01c00;
}
.vtab button:first-of-type {
margin-top: 4px;
}
</style>
</head>
<body>
<div class="vtab" id="vtab"></div>
<script>
$(function() {
var i = $('.nuTabSelected')[0].id.replace('nuTab','');
$('.nuTab[id^="nuTab"]').each(function (index) {
$(".vtab").append('<button class="tabbuttons' + ((i == index)? ' active' : '') + '" name="tabs[]" onclick="openTab(event, \''+$(this).html()+'\')">'+ $(this).html() +'</button>');
})
// Set vtab width to the parent width
$('button.tabbuttons').css('width',$('#vtab').parent().width());
$('#vtab').css('width',$('#vtab').parent().width());
$('#vtab').css('height',$('#vtab').parent().height());
});
function openTab(evt, tab) {
tabbuttons = document.getElementsByClassName("tabbuttons");
for (i = 0; i < tabbuttons.length; i++) {
tabbuttons[i].className = tabbuttons[i].className.replace(" active", "");
}
evt.currentTarget.className += " active";
nuSelectTabByTitle(tab);
$('#vtab').parent().show();
}
function nuSelectTabByTitle(tab) {
$('[id^=nuTab]').each(function (index) {
if ($(this).html() == tab) {
var tabNumber = +index -1;
var e = document.getElementById('nuTab' + tabNumber);
nuSelectTab(e);
$('.nuTab[id^="nuTab"]').hide();
return true;
}
});
}
</script>
</body>
Code: Select all
if (nuFormType() == 'edit') {
$('.nuTab[id^="nuTab"]').hide();
$('#vtabs').show();
$('#nuTabHolder').height(1);
$('#nuTabHolder').css({"height":"1px"} );
}
Re: tabs with multiple rows
amit,
I have just added this to nuBuilder...
nuSetVerticalTabs()
https://wiki.nubuilder.cloud/ ... rticalTabs
Steven
I have just added this to nuBuilder...
nuSetVerticalTabs()
https://wiki.nubuilder.cloud/ ... rticalTabs
Steven
-
- Posts: 36
- Joined: Sat Jun 02, 2018 1:26 pm
Re: tabs with multiple rows
Guys, thank you! I think I'll go for Tom's solution as it looks a little more attractive from a visual point of view.