1rosehip / jplist

jPList jQuery Data Grid Controls is a flexible jQuery plugin for sorting, pagination and filtering of any HTML structure (DIVs, UL/LI, tables, etc).
http://jplist.com
Other
436 stars 177 forks source link

reload jplist in SPA #253

Open wushan opened 7 years ago

wushan commented 7 years ago

I am using jplist in a vue.js spa with store locator bundle.

it works like a charm when loading in the page directly but if user navigate to another page/route then come back again, the jplist instance still work there, google maps gone. I checked the 'hide /show map example', it uses google.map.event.trigger(instance, 'resize') to load the map back, but since spa destory DOMs while navigating, that map instance isn't exist when I came back to the store locator page.

So, is there any approach to let me reinitialize the map or the jplist it self each time entering the route ?

1rosehip commented 7 years ago

If you have possibility to run some code before and after each route you may try the following approach: