[Bug-1715]Apply Subview to a Subset of Perspective Table Rows

Hi All,

I’m working in Perspective, 8.0.16.

Wondering if there is a way to apply the subview functionality in the Table component to a subset of rows. In the table below, for example, the Picking Area has a set of children areas to display, but the Merge Area doesn’t have any children. Is it possible to remove the icon and expand functionality just from the Merge row?

Thanks.

There is, but it’s a little complicated.

If the actual data property must contain a setting for the subview, which allows you to disable that functionality for a single row.

In the following screenshot, you can see that the final row within my data property has two objects for the row: value and subview. The subview property also has an internal key of enabled. This enabled key is what determines the individual row’s presence of a subview. The value property is where the true “data” of the row is stored.

1 Like

That did it, thanks for the help! That’s a neat trick to know for tables.

As a note for other people reading this, I noticed that by defining the rows explicitly in the data[] property, the rows{} property was overwritten. So I also had to include a viewPath under the data[].subview{} property instead of listing it in the rows{} property. I assume this works the same way for the rest of the row properties.

That shouldn’t be required. My current setup works fine without it - as you can see from the screenshot. Can you clarify this:

Sure - maybe I misunderstood your steps.

Following your instructions worked to allow/restrict the subview dropdown functionality for each row, but the actual subview failed to show in my table.

For testing, I created a 2-row table, one (row a) with the subview functionality, and one (row b) without. Notice that I set the subview viewPath property in the rows{} property.


When I ran this, the subview icons showed as expected for the 2 rows, but the subview didn’t show:

This looked to me like the subview viewPath property had been overwritten by what was defined in the data property. So I added a viewPath property to data.subview, and the subview appeared.


Let me know if I’m missing something.

Thanks.

Ah, yes, that’s an oversight on our part. I’ll open an internal ticket to address that. If you are supplying the subview object for each row, then you’re right - you must also supply the viewpath property.

Sorry, I had believed you were just targeting a single row.