I've been using a custom JS query which allows user to select all rows in a table, while allowing the users to do multiple selection manually by clicking.
table1.selectRow(_.range(0, table1.displayedData.length-1))
(From this post )
However, recently the custom JS stopped working unless I change the selection mode to single. Is this an expected behaviour or if there are any way to workaround so that I can have the select all functions while allowing the users to do multiple selections manually on a table?
If I then select some rows selectedRow looks like htis:
I also confirmed it only affects multi-select tables. I also tried tblProducts2.selectRow([]) and tblProducts2.selectRow(null) which both have the same effect.
Edit:
Clicking the "Clear Selection" link in the table properly clears the selection.
Hi @AnsonHwang It should work in the new table if you put the array of rows to select in an object {index: [array_here]} See the docs for the full syntax
Can we bump this? The table.selectRow() method in the component library still doesn’t reflect how to select multiple rows. In fact, the component library says it expects a string.
Hi there! I agree that it is a bit confusing I will reach out to the docs team again to update this page, and I can also look into updating the in-product documentation (the tooltip that shows when you type table.selectRow in a JS query) to show that you can use it for multiple rows