How can i build Expand colapse Grid using datagrid2 / Template grid / List view ?
0
i want to build this UI in mendix how can we build this exact thing what should i use datagrid2 / Template grid / List view ? what is the best way to build this
asked
Tushar Rajput
1 answers
0
List View:
Display your main (parent) records using a List View.
Add a Boolean attribute to the parent entity, such as isExpanded.
Inside each List View item, place a button or icon (like a chevron) that triggers a nanoflow to toggle the isExpanded value between true and false.
Add a container or group box within the List View item to hold the child details.
Set the visibility of this container to show only when isExpanded is true.
Inside the container, use another List View or a DataGrid2 to display the related child records.
Data Grid2:
Alternatively, if you're using DataGrid2, the setup is slightly more advanced:
Enable custom content inside each row of the DataGrid2.
Add a Boolean attribute to the entity, such as ShowDetails.
Include a toggle button or icon that calls a nanoflow to switch the value of ShowDetails.
Use conditional visibility or dynamic styling to show or hide the expanded section.
In the expanded section, you can include a List View or any other widget to display child data.
Let me know if you'd like help building the nanoflow or designing the domain model for this setup!