[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.

Hello, I am attempting to allow subviews for a subset of data but can't seem to get it working even following this guide. As it is, no subbview arrow becomes available so subviews can't be seen on any row.

I am running 8.1.18

Thanks!

Good Morning Steve,

Here are a few things to try:

  1. Put the fully qualified path to the view 'table' in viewPath.
  2. Make the subview folder as simple as possible (mine used only the 'enabled' and 'viewPath' elements) and worked, so start there).
  3. If those don't work, simplify the whole data structure to match mine in the example. Instead of adding the subview to ann existing dataset with all the extra fields, I dynamically (programmatically) created the dataset and built just what I needed in it.

Have a good day,
Matt

Hey Matt,

Thanks for the tips. It was indeed a formatting situation. I was able to make it work by matching your foramt by placing the entire payload into an object with a key of 'value' and then another object on the same level with a key of 'subview' with the subview parameters. It is now working as expected.
image