You need to sign in to do that
Don't have an account?
Ian Quah
Conditionally display html based on apex:variable
<script> function myMod(num, denom){ alert(num % denom); return (num % denom) == 0; } </script> -- stuff <apex:variable value="{!1}" var="rowNum"/> <apex:repeat value="{!things}" var="thing"> -- stuff -- <apex:outputPanel rendered="myMod({!rowNum}, 4)" layout="none"> <hr/> </apex:outputPanel> <apex:variable var="rowNum" value="{!rowNum + 1}"/> </apex:repeat>Can anyone point me in the right direction with how I add breaks to the display within a repeat tag?
<div class="slds-col slds-size--1-of-1 slds-medium-size--6-of-12 {!IF (MOD(rowNum - floor(rowNum / 4), 3) == 0 || MOD(rowNum - rowNum / 4, 4) == 0,"slds-border_bottom",'')} ">
All Answers
but nothing seems to be showing up still.
<apex:outputPanel rendered="!{!MOD(rowNum, 2) == 0}" layout="none"> <hr/> </apex:outputPanel>
Could you post your complete VFP?
My code is attached above. I tried to remove any parts I thought were "redundant" to make it more general purpose
Here is a first technique.
<table class="slds-table {!IF(MOD(rowNum, 2) == 0,"slds-table--bordered",'')} slds-max-medium-table--stacked" >
Now the new puzzle is to have two columns and a line break in SLDS every four fields.
I will try to solve this new problem for the fun.
<div class="slds-col slds-size--1-of-1 slds-medium-size--6-of-12 {!IF (MOD(rowNum - floor(rowNum / 4), 3) == 0 || MOD(rowNum - rowNum / 4, 4) == 0,"slds-border_bottom",'')} ">