Loading filepicker widgets fails

112 views Asked by At

I'm having a weird issue. I'm using the filepicker 'pick' widget to upload a logo. When the page is first rendered, the widget is shown. However, if I navigate away from the page and visit it again, the widget is not rendered. I have to explicitly clear the cache to see it again. Any help would be greatly appreciated.

1

There are 1 answers

0
Gokul On

Is your app using something like Pjax to load the pages? Filepicker initializes the widgets on page load. If the page is loaded via something like pjax, then the widgets will need to be re-initialized everytime you navigate to that page.

eg: filepicker.constructWidget(document.getElementById(idOfElementToBeConvertedToWidget))

I've had to do this on an app that I am building that uses Pjax.