URL parameters don't work with new table

,

Hello, I have a new table component use URL parameters.
I want to use hash to remenber the last selected row.

Here is screenshot.

Yes, all thing go well by now. I change the row, and the hash in the addressbar is change according.

But When I refresh the page, it will lost the value of selectedRowKey

I add the event handler to row change which will show a notification.

It seem the event handler was trigger multi-time.

I try use js(window.history) in row change event handler to modify the href in address bar but seem not work? Maybe the js run in sanbox without that permission?

window.history.pushState('', '', '#reviews');

Any help?

Hello @AnsonHwang, have you tried storing the variable inside of the local storage? And just updating the variable when you change the row?

Not, There can't work.

After many time testing and fail. I give up to use URL Parameters way.

The js I wrote is runed in sandbox, so I can't use any api to change the browser location.

Here is my workaround.


Set go to app in the change row selection event handler of app, and in the configuration, config the hash here.

If you go to the same app as the app you visted, it will not refresh the page, unless you check open in new tab.
image

Now, it's success. Once you change row, the hash change accordingly.
I also configure the default key, even I refresh the table, I can get the row which id in the hash selected.

Animation

Here is app json
4db05b8b-b837-4675-847d-e1832f09d4fbss.json (173.9 KB)

I also think this is a bug should be fixed.

1 Like

I also find another solution - using utils.openApp

image

1 Like

Thanks, @AnsonHwang. Yes, there is a bug here that we intend to fix!

1 Like