Pregunta

I created a SPFx BaseListViewCommandSet extension. My component puts the status of all selected rows. The update works well.

However, when I want to refresh the page (location.reload ();) at the end of the OnExecute method, the page does not refresh.

In debug mode, the page refreshes, in package deployed mode, the page does not refresh.

@override
  public onExecute(event: IListViewCommandSetExecuteEventParameters): void {
  //code ...
  location.reload ();
}

enter image description here

I still used reload(true); and reload(false);

Any Idea ?

¿Fue útil?

Solución

Maybe a screenshot of the code before the location reload will be a big help in this case.

location.reload()

should work, try debugging your code remove the codes before the location reload then if it does reload something wrong with your code that prevents the processor to reach the line where location.reload is, have you tried looking at your console during the process?

you can also try this 1 if your goal is just to refresh the page

location.replace(location.href)

Hope the concept helps! Happy Learning!

Otros consejos

Try accessing in different browsers - if the issue still persists, try the below:

Try using passing the boolean parameter:

Syntax:

location.reload(forceGet)

Example:

location.reload(true)

Explanation:

  • true - Reloads the current page from the server
  • false - Default. Reloads the current page from the cache.
Licenciado bajo: CC-BY-SA con atribución
scroll top