hi @AndrejPavlik18 ,
First, initialize an empty collection in your OnStart property of the app:
ClearCollect(colExpandedGroups, {GroupName: "", IsVisible: false});
Update the OnSelect property to toggle the visibility state in the collection:
Set(varGroupName, ThisItem.'New colum');
If(
CountRows(Filter(colExpandedGroups, GroupName = varGroupName)) > 0,
UpdateIf(colExpandedGroups, GroupName = varGroupName, {IsVisible: !LookUp(colExpandedGroups, GroupName = varGroupName).IsVisible}),
Collect(colExpandedGroups, {GroupName: varGroupName, IsVisible: true})
);
Select(Parent);
Set the Visible property of the nested gallery to check the visibility state from the collection:
LookUp(colExpandedGroups, GroupName = ThisItem.'New colum').IsVisible
To ensure that data reloads when the group is expanded or collapsed, you might want to refresh the gallery. You can do this by adding a Refresh action in the OnSelect property:
Set(varGroupName, ThisItem.'New colum');
If(
CountRows(Filter(colExpandedGroups, GroupName = varGroupName)) > 0,
UpdateIf(colExpandedGroups, GroupName = varGroupName, {IsVisible: !LookUp(colExpandedGroups, GroupName = varGroupName).IsVisible}),
Collect(colExpandedGroups, {GroupName: varGroupName, IsVisible: true})
);
Refresh('Best Practice Ideas');
Select(Parent);
You don't need to change the Items property of the nested gallery, but ensure that it properly filters based on the current group:
Switch (
varSortColumn;
"Ideadescription";
SortByColumns(
Filter(
ThisItem.Data;
StartsWith(
'Idea description';
TextInput1.Text
);
(Plant.Value = ComboBox1.Selected.Value || ComboBox1.Selected.Value = Blank());
(ComboBox1_1.Selected.DisplayName = Blank() || Author.DisplayName = ComboBox1_1.Selected.DisplayName);
(Created >= DatePickerCanvas1.SelectedDate)
);
"Ideadescription";
If(
varSortColumn = SortOrder.Ascending;
SortOrder.Ascending;
SortOrder.Descending
)
);
"Created";
SortByColumns(
Filter(
ThisItem.Data;
StartsWith(
'Idea description';
TextInput1.Text
);
(Plant.Value = ComboBox1.Selected.Value || ComboBox1.Selected.Value = Blank());
(ComboBox1_1.Selected.DisplayName = Blank() || Author.DisplayName = ComboBox1_1.Selected.DisplayName);
(Created >= DatePickerCanvas1.SelectedDate)
);
"Created";
If(
varSortColumn = SortOrder.Ascending;
SortOrder.Ascending;
SortOrder.Descending
)
)
)
With these changes, clicking on multiple buttons will expand the respective tables without closing the previously opened ones, and you can see multiple tables simultaneously.