Double Click on Table results in Null Result

Hello!

We currently have a data table that shows users our product inventory. The table is enabled for multiple row selection however we found that this interferes when a user double clicks on a row. When a user double clicks on a row, we expect the modify form modal to pop up that is populated with the content from that selected row. Unfortunately, when a user does a cold double-click, the form shows up as empty because no row was selected.

I know that Retool is able to document the selected cell and the cell index so I wanted to use that as a work around to populate the modify form with contents from the row at index x.

I have this code that gets the index but I'm having trouble with the row selection. I get the console.log message of undefined.

let userSelectedIndex = ciProductTable.selectedCell.dataIndex;

console.log("Row: ", ciProductTable.selectedRow[userSelectedIndex])

console.log("Selected Row at index ", userSelectedIndex, " is: ", ciProductTable.selectedRow);

Any tips for how I can get this resolved will be greatly appreciated!

Best,

Hi @mayraSanchez! To clarify, you're looking to use a double-click instead of a single-click, or you want them to trigger different events?

It seems that the event doesn't receive the row that triggered the double-click event, only the rows that were already selected. It looks like the selectedRows object stores them in the order they're selected but double clicking doesn't add the row to the array.

You can get around this by adding a click row handler to stash the ID or row object in a variable, then reference that variable in the double-click handler. Would be nice to be able to access this from self though.

Hi,

I ended up being able to resolve this on my own and forgot to update on here. On the table, I included this script to run on doubleClick
let x = ciProductTable.selectRow({ mode: "key", key: currentRow.id});

So now we have both multiselect enabled with double click as well. This code unclicks everything that was selected that was not the double-clicked row.
image