Adding space between the sections in Related Items
What I have works in the browser's console but won't work in the JS file (either in document.ready or window.load).
<p>var tabid = $("[data-cid*='RelatedItems']")[0].hash </p><p>var childdiv = $(div=tabid).children('div') </p><p>for (i = 0, len = childdiv.length; i < len; i++) { </p><p>childdiv[i].style.paddingBottom = '70px' </p><p>}</p>The tab pane div id changes at every refresh. That is why I target the RelatedItems button to get the ID (this seems to be the part that doesn't work in the JS file). Then it works pretty well to get the child rows and add space between them.
The result
Best Answer
-
Martin_Blomgren Customer Ninja IT Monkey ✭✭✭✭@Marc-Andre_Lafleur
I can see several approaches to solve your initial problem where its hard to see where one section begins and another starts.
Use CSS to highlight a section without padding to much (less amount of scrolling):
CSS for highlighted sections:@media only screen and (min-width: 1000px) {<br> .page_content .container-fluid .form-panel .tab-content .panel {<br> /* border-left: 2px solid #aaa; */<br> /* border-top: 2px solid #aaa; */<br> border-radius: 0;<br> padding: 13px;<br> margin-left: 30px;<br> box-shadow: 0px 2px 5px 0px rgba(0,0,0,0.25), 0px 2px 10px 0px rgba(0,0,0,0.18);<br> margin-bottom: 10px;<br> }<br>}
Use CSS to add those 70px off padding:.affecteditems-grid,<br>#RelatesToWorkItem,<br>.relateditems-grid,<br>.file-attachments {<br> padding-bottom: 70px;<br>}
The JS way:<span>app.custom.formTasks.add('Incident', null, function (formObj, viewModel) {<br> //bind a function to the form ready event<br> formObj.boundReady(function () {<br> var tabid = $("[data-cid*='RelatedItems']")[0].hash<br> var childdiv = $(div=tabid).children('div')<br> for (i = 0, len = childdiv.length; i < len; i++) { <br> childdiv[i].style.paddingBottom = '70px'<br> }<br> });<br>});</span>
1
Answers
I am going to space these out and gather some user feedback, because users have commented to me that they are confused by these controls until they have been using the system for a while (usually also after I have explained it to them). It isn't always clear where one stops and the other begins, unless you have spent as much time with the product as those of us who post to this site have. It is true that this might cause complaints about the amount of scrolling, but I think that is a good trade.
Thanks for the great post!
I can see several approaches to solve your initial problem where its hard to see where one section begins and another starts.
Use CSS to highlight a section without padding to much (less amount of scrolling):
CSS for highlighted sections:
Use CSS to add those 70px off padding:
The JS way:
The first option looks a lot better than what I was trying to do. I will try it today.
Thanks for sharing and helping!