function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rashika SinghRashika Singh 

I want to to use show and hide instead of aura if,How can i use?

I want to to use show and hide instead of aura if,How can i use....

 <aura:if isTrue="{!v.deviceStyle}">
                                    <div class="slds-col slds-size_4-of-5 slds-card__body">
                                        <c:Product_Details  aura:id="childComponent1"  startPage="{!v.startPage}" endPage="{!v.endPage}" pageSize="{!v.pageSize}" sortAsc="{!v.sortAsc}" totalRecords="{!v.totalRecords}" productlist1="{!v.productlist1}" listOfAllProducts="{!v.listOfAllProducts}" totalRecordsCount="{!v.totalRecordsCount}" bNoRecordsFound="{!v.bNoRecordsFound}" productList="{!v.productList}" totalPagesCount="{!v.totalPagesCount}" recordId="{!v.recordId}" scroll="{!v.scroll}"/>
                                    </div>
                                    <aura:set attribute="else">
                                        <div class="slds-col slds-card__body slds-scrollable">
                                            <c:Product_Details  aura:id="childComponent1" startPage="{!v.startPage}" endPage="{!v.endPage}" pageSize="{!v.pageSize}" sortAsc="{!v.sortAsc}" totalRecords="{!v.totalRecords}" productlist1="{!v.productlist1}" listOfAllProducts="{!v.listOfAllProducts}" totalRecordsCount="{!v.totalRecordsCount}" bNoRecordsFound="{!v.bNoRecordsFound}" productList="{!v.productList}" totalPagesCount="{!v.totalPagesCount}" recordId="{!v.recordId}" scroll="{!v.scroll}"/>
                                        </div>
                                    </aura:set>
                                </aura:if>    
ANUTEJANUTEJ (Salesforce Developers) 
Hi Rashika,

I see that you are using the VF pages so as you are using the aura tags are designed to work with the framework so I think it might be better to use them but I am not quite sure if you can use show and hide.

I hope this helps.

Regards,
Anutej
David Zhu 🔥David Zhu 🔥
You may use  <div style="display:{!if(v.deviceStyle,'','none'}"> to replace <aura:if isTrue="{!v.deviceStyle}">.
The difference is <div...> will hide but still render the section when v.deviceStyle does  not equal to true