How do I make sure a collapsed header stays collapsed after refresh?
I have section A which is in a row-repeat layout. I have 2 sections (B & C) embedded in section A wherein both are using collapsible header types. Section B stays collapsed but section C gets expanded when I add a new row and the screen gets refreshed. Any ideas?
So basically in design time both Section B and Section C layout headers are kept collapsed by default. But during run time, as and when rows are added, Section B remains collapsed whereas Section C is expanded.
By default, sections B and C are expanded. After the user input details into the sections, the user collapsed the 2 sections and then clicked on add. A new row is then added. So I now have 2 section As.
Section A1 has section B1 collapsed and section C1 expanded. Section A2 has section B2 expanded and section C2 expanded.
My issue here is that section C1 should stay collapsed since the user set it to collapsed before adding a new row.
Is there any specific need not to use OOTB Add Row button.OOTB add row button does not have this issue.Seems like Add Row button outside the section has impact .If possible use OOTB button for Add Row.
And yes As Sathish suggested , modify the design to use Grid Layout.
Thing is in case of old row repeat layout, even though we use OOTB add row action, we still do refresh of the whole grid. Now to get the partial refresh functionality, the application developer has to check row reordering in the layout property panel. Basically with this option checked, we use grid generation logic to generate row repeat thereby enabling partial refresh.
And one more thing, Add row button has to be within the purview of either the row repeat layout / Grid layout (either in grid action top or bottom). We cannot target add action from outside of repeating structure (the only exception to this rule is Repeating Dynamic Layout). But we are actually planning to enhance this so that users can target Add row action using datasource. This will remove the tight coupling of Add row action with the layout.
Can you switch to Grid layout instread of Row Repeat layout ?
Using grid layout, you will be getting the OOTB partial refresh feature i.e. when you add a row, only the newly added row's markup will be brought back from then server and gets appended to the DOM. Since the exisitng rows are not getting refreshed, the collapsed / expanded state of the section will remain intact.