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
437 stars 177 forks source link

jplist destroy #290

Open elma6394 opened 6 years ago

elma6394 commented 6 years ago

Hello,

is there a way to destroy the jplist instance?

I have a page where users toggle between scroll and pagination. if they click on pagination, I use jplist to show the results as a pagination format and if they click on scroll, i need to remove jplist to show the results with scroll bar.

thanks

elma6394 commented 6 years ago

i really need help on this. i've been trying to figure this out for the past few weeks, but the plugin is not working properly.

I empty jplist and add new items to it, but there is always data left over

Thanks

elma6394 commented 6 years ago

i really need a way to destroy and restore the list items back on the page. i really want to use this plugin, but if this is not possible, i will not be able to use this plugin for my use case above.

thanks

1rosehip commented 6 years ago

Hello, There are some known issues with destroy functionality in jplist. Maybe you can consider show / hide instead of delete / restore?

elma6394 commented 6 years ago

i thought about that too, but the problem with that is when users switch from scroll view to pagination view (jplist), they may have changed data in scroll view, which i need to pass to the pagination control to display (destroy or refresh). on the other hand, if users change data on the pagination view, I need to get those items and show the changes on the scroll view. From my research so far, jplist saves the data internally and shows the data based on the page they are in. the problem with that is when users switch back to scroll view, the data on the page is incomplete because the data is being saved internally by jplist.

thank you for your response.

1rosehip commented 6 years ago

Have you tried this remove api? https://jplist.com/documentation/api-remove-all-items

elma6394 commented 6 years ago

i actually spent a long time trying to refresh data using the command: empty, but it did not work for my use case above.

thanks

1rosehip commented 6 years ago

It's a bit difficult to help you without seeing the actual code. Please create your test case in jsFiddle, jsBin or other playground so I could investigate it.

brendonwm commented 6 years ago

I think I have the same problem. Calling .jplist(...) again on the same container to update the AJAX data source URL seems to confuse the paging and/or display old data?

I've tried:

This issue might be related? https://github.com/1rosehip/jplist/issues/256