[FEATURE-13925] Perspective Table On Click Event Doesn't Fire Script

I installed the latest Nightly Build this morning and lost all the on-click events on my perspective tables. I had to move them all to Mouse Up events.

Has anyone else seen this?

Hi,

Sorry for the inconvenience. Yes, you’re not the first one to see this. The reason for this is to prevent events from propagating upward when you have nested tables within subviews. What is that you’re trying to achieve? The better solution might be to provide more specific events resulting from interaction of internal features (see [Feedback] NEW Perspective Table).

Let me know if there’s a specific event you would like to see exposed in available component events.

-Yousuf

I’m trying to pass the selection data to a popup for some indirect tag referencing. What would be the best event to drive this?

How about onSelectionChange? Where the event contains the selection data. Which you can then use to trigger a popup?

I don’t see onSelectionChange as an event for the table. Am I missing something? I see onSelect but I haven’t been able to get that to work.

Hi,

No, you’re not missing anything. It hasn’t been added yet, but it’s on my list to do for this week.

-Yousuf

Curious. Is your goal to show a popup when selection changes?

Yeah. Have a popup show with some of the selection information passed in.

1 Like

Okay. I’m adding an onSelectionChange event that will provide an event object containing the selected row, column, and data. In the meantime, have you tried setting a property change script on the selected column and selected row properties?

Yeah, as of right now I have a custom property bound to the selection, and when that changes it opens the popup and passes the selection through. I’m just hoping for an event :slight_smile:

1 Like

@ynejati Hey I was wondering if you know the status of the proposed onRowDoubleClick event?

Hi,

It is undergoing final review and hopefully will be available in tomorrow’s nightly. I will notify you when it is available. I will also post details on the new events in the http://forum.inductiveautomation.com/t/feedback-new-perspective-table post.

-Yousuf

1 Like

Hi,

Just posted this in the feedback post, but I’ll post it here as well. Should be available in the next nightly build.

onSelectionChange : { selectedColumn: string | number | null, selectedRow: number | null, data: Array<PlainObject> }
onCellEditStart : { column: string | number, row: number, rowIndex: number, value: any }
onCellEditCancel : { column: string | number, row: number, rowIndex: number, value: any }
onRowClick : { row: number, rowIndex: number, value: PlainObject }
onRowDoubleClick : { row: number, rowIndex: number, value: PlainObject }
onSubviewExpand : { row: number, rowIndex: number, value: PlainObject }
onSubviewCollapse : { row: number, rowIndex: number, value: PlainObject }

Some things to note:

  • For onCellEditStart and onCellEditCancel, the value is the initial value, before any edits.
  • onSelectionChange will fire on startup or mount if props do not equal the table components default selection config { selectedColumn: null, selectedRow: null, data: [] } .

-Yousuf