Perspective Table Selected Data Only Shows Visible Data Columns

I am currently working on designing a queue management tool in which I am using the perspective table as an interface for the user to reorder rows, insert new ones, and delete existing ones.

To allow for inserts and re-ordering I am using a “priority” column in my data to determine ordering. The ordering itself is mostly done via stored procedures and triggers in the database and there is no need to show it in the actual table so I do not have a column showing it even though it is still part of the data in the table data property. Since I am using the priority of a specific row as a parameter in many of my procedure calls, I need to know this value and not just the row index in many of my procedure calls. However, the data field of the “selection” property for the table only seems to show columns that are visually included in the table.

This is not a huge issue since I can easily get around it but I was wondering if anyone knew why this was the case? I think it would be very valuable to have all data, not just visible data, shown in the “selection” property.

It seems to work for me as shown below.

*Figure 1. Make sure the column is named and visible: false.

Figure 2. The hidden column’s data shows up in the selection.data.

My mistake; by hidden I mean not actually included as a field in the column property.

That’s the problem then. (I’ve confirmed it on my test application.)

Add the column and set visible: false and you should be in business. Is there any reason this won’t work for you?

In this specific case, no. I can just do that. However, I have built tables where the columns are dynamically created via an analysis script in conjunction with the Sepasoft modules. In that instance adding them as invisible columns would be very annoying to do. As I mentioned before, it’s not something that is hard to get around, but rather just an unexpected behavior.

I think the behaviour is reasonable. The table is constructed of columns which are a subset of the result set. Anything not ‘columised’ can be considered irrelevant and therefore wouldn’t show up in the selection.

I think the workaround of using that invisible column is going to be your best bet. Alternatively, if your data has a primary key or other unique ID, you could use that as the invisible column and then query your data property based on that unique ID in tandem with using the ‘selection.data’ property.

If you want to, I would recommend this as a good topic for a Feature Request, which you can submit at our Features and Ideas page.

1 Like