Hello All,
I've been utilising the creator kit components in a new app, in particular the detail list component.
One problem I have been experiencing however is using the "expand" cell type. I have been able to use this by following the code in the reference app, and replicating this in my app.
However, using this with a dataverse datasource/dataverse views is more challenging - in the examples provided in the MS Docs, GitHub Repo/Reference Apps, they all use a local collection, in which they patch an "expand" column to work as the trigger for expanding the column.
How could I replicate the behaviour with a dataverse datasource? AddColumn to add a similar column to patch, or creating a collection, would unfortunately remove the automatic sorting functionality or undermine the design, which is a key functionality for our use case.
Sample Code from Reference App:
Button:OnSelect:
ClearCollect(
colAccountsExpand,
{
id: "1",
name: "Contoso",
city: "Redmond",
country: "U.S.",
description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
expand: false,
TagColor: "rgb(0, 183, 195)",
TagBorderColor: "rgb(0,137,147)",
externalimage: "https://via.placeholder.com/100x70",
iconimage: "icon:SkypeCircleCheck",
svg:varSvgSpinnerImage,
tags:["#PowerApps","#PowerPlatform"]
},
{
id: "2",
name: "Litware, Inc",
city: "Dallas",
country: "U.S.",
description: "Donec vel pellentesque turpis.",
expand: false,
TagColor: "rgb(255, 140, 0)",
TagBorderColor: "rgb(194,107,0)",
externalimage: "https://via.placeholder.com/100x70",
iconimage: "icon:SkypeCircleCheck",
svg:varSvgCheckmarkImage,
tags:["#MsDyn365", "#PowerApps"]
}
);
DetailList:columns_Items:
Table(
{
ColName: "name",
ColDisplayName: "Account Name",
ColWidth: Self.Width-32-32-48,
ColIsBold:true,
ColResizable:true
},
{
ColName: "city",
ColDisplayName: "City:",
ColShowAsSubTextOf:"name",
ColLabelAbove:false,
ColIsBold:true,
ColSubTextRow: 1
},
{
ColName: "country",
ColDisplayName: "Country:",
ColShowAsSubTextOf:"name",
ColLabelAbove:false,
ColIsBold:true,
ColSubTextRow: 1
},
{
ColName: "description",
ColDisplayName: "",
ColShowAsSubTextOf:"name",
ColLabelAbove:false,
ColIsBold:false,
ColSubTextRow: 2
},
{
ColName: "expand",
ColDisplayName:"",
ColCellType:"expand",
ColRightAligned:true,
ColWidth: 32
}
)
DetailList:Items:colAccountsExpand
DetailList:OnChange:
If(Self.EventName="CellAction" && Self.EventColumn="expand",
With(LookUp(colAccountsExpand,id=Self.EventRowKey) As Row,
Patch(colAccountsExpand,Row,{expand:!Row.expand})
)
);
RecordKey: ="id"