JS refresh list

Is there a better way than location.reload(); when having a request ajax answer from a controller to show the updated list?

If I do a OC request like this:

oc.request('.subscription-date-form', 'onRestore', {
     ...

And when I then do in the controller:

$this->listRefresh();

The page keeps refreshing forever, so I have to do it in the success ajax request.

location.reload(); works, but I was wondering, if there is a better (ajax?) way?

listRefresh is the way, I’m not sure why it would be refreshing forever. It should only do it once, unless your JS code is executing inline with the partial update.

1 Like

I’m having a button in each column that each can trigger a modal which then may duplicate and force delete an entry. I do event.preventDefault(); in my jQuery click events, but maybe something is triggered again on list refresh.

Anyway, it works with the JS location.reload(); workaround.