Open popup on table cell click

I have a table and depending on which cell is click on, I would like a certain popup to open. I “think” this would use an if then but I can’t get the syntax correct and I get errors. I do have the below and no matter which cell is click, it opens the popup which doesn’t surprise me because I know I have something incorrect.

So in this example if I click the cell in row 3 and column 2 then I would like Test 1 popup to open but if say I click the cell in row 1 and column 1 nothing would popup in this case.

(event.source.selectedRow==3 and event.source.selectedColumn==2)
system.nav.swapTo(“Fueling Site/Test 1 Popup”)

Thanks for any pointers!

I’ve made progress. Amazing what watch their videos can do!


I’m not sure how to quantify “progress”, but you can use this:

if (event.source.selectedRow==3 and event.source.selectedColumn==2):
	system.nav.swapTo(“Fueling Site/Test 1 Popup”)

Also, it’s best if you briefly describe your issue in the topic title, as opposed to something generic like “I need help”. And if you manage to solve your issue, providing the solution for others who may have the same issue in years to come :slight_smile:

The main issues were the :

if (event.source.selectedRow==3 and event.source.selectedColumn==2):

and then the

TAB/Indent system.nav.swapTo(“Fueling Site/Test 1 Popup”)

Hope that made sense and thanks for the reply!

Edit…Here is the video that helped me.

There exist a scripting function when clicking a cell. I think “OnCellClick”. Use that function to map your click

Thank you tordvd. I’ll have to search that.

In a table, I have a column rendered as a view to show a button. Clicking on it opens a popup with more details. It didnt worked well at first, but it does now with release 8.1.1.

“Selected rows within a Table Component no longer prevents click events to views rendered within the Table.”

Using OnCellClick is a good way if you want to display the values instead of a button like me.

For using the OnCellClick, is there a way to push the actual cell data into usable info for the popup?
e.g. my table has rows with numbers 1-5. When someone clicks onto these rows, popups 1, 2 etc would open when clicking onto the respective numbers.

Is there a way to push those numbers onto the popup configuration? I can browse properties but am not sure how to refer to a specific row of data, even using the props.selection.selectedRow, which gives you the selected items row number.

Update: I’ve changed to using a script instead and it has successfully pushed through on click. However, for some reason, my parameter is not getting input and the default value has been taken instead. I had written the following:

system.perspective.openPopup(“PopupID”, ‘folder/folder/popup’, params = {‘parameter’: event.value })

Where the event.value is the row value from the table. It is logged as a JSON object, not sure if that affecs it.