im using a table with filter depending from dropdown value.
ther’s also a functions on “OnTable.rowselection” that works ok… but when i change filter of dataset the first row still selected and click on in not call the function…
ther’s a way to reset the selected row so i can click again on it?
thanks
He didn’t want to re-select it but to reset the selection (meaning to cancel the selection).
I believe .refresh() should work and I’m not sure why it didn’t work for him.
@jonatandor35 Well, he wanted to reset so that he could select again (reselect). I’m also not sure why a result didn’t work. To be honest, I didn’t try it. Maybe it works. Also, not sure why he wants to reselect, but who am I?
A Repeater is the best solution as it’ll allow him to do a whole lot more than a Table allows.
OK. I’ll explain what I understand form his question (even though it could be better if he explained it himself).
So, he has a table, the user selected a row, then the data table got filtered but the selected row index is still shown as selected even though it’s different data now. He wants to remove the wrong selection, to allow the user to manually select it if he wants. I think that’s it.
@jonatandor35 I understand. But what I don’t understand is why the table refresh doesn’t work. Maybe what’s needed is to clear the Table rows property first, and then repopulate. Strange.
@jonatandor35 you’re right, so just to be clear, the table is a repeater table…
and row selection will show a button.
if table had autoselected row by changing filter… click on it have not effect and button not show. This issue comes only if ther’s a only row in table…
if table show more rows, just click on 2th or another and reclick on the first…
and this time, (on.click event) is performed.
Hello guys I have a similar issue, I used a table in a repeater, so that gives me multiple tables. I use them like a menu with submenu or multiple list with category. When I click a row of one table, I want that other tables in the repeater reset their selections. I used the refresh method as @yisrael-wix mentionned, but it only works in dev/preview environment, when published the refresh does nothing. I also tried to clear the data in the table (table.rows = [] and set it back with a timer half second later, but it still reselect the row that was selected before. It’s kind of weird that the refresh isn’t working when published… Any idea?
The page is named Wix, the code is really simple, a repeater containing a table with this code, the table refresh in preview mode, but not when published.
$item( '#table1' ).onRowSelect(()=>{
// here i would filter some data to display underneath the repeater.
$w( '#repeater1' ).forEachItem(($itemR, itemDataR, indexR)=>{
@yisrael-wix Hello! I think I have the same problem… First of all, I can answer on the question why somebody (me ) need to “deselect” hover selection line in table. Very simple: one column table and one button “remove”… I select one row, click remove - Line removed. “Line” removed from table and connected database, but Hover Selection stay colored on the same table row level… Stay but not connected with real table line…
refresh () working only if you change sort filter and refresh database and table… But Hover - stay colored… Very easy… I’m clicked on thу Row - select - Remove - and… WHANT NO SELECTION until select again…
But now methods to UNSELECT …Only if you reload page and table startup again - it opened without Hover Selection
I’m afraid that there are “no” Properties to DESELECT hover without reloading all page, I think that no Color Code-change-based command Yet (5 years ago this possibility already was requested - but nothing).
Any Idea
PS: For such simple situation no reason design repeater-based code- but I did this - it-s working. Question about Table API - Why this (reset selection) not set up?