jplist icon indicating copy to clipboard operation
jplist copied to clipboard

jplist destroy

Open elma6394 opened this issue 7 years ago • 8 comments

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 avatar Nov 13 '17 19:11 elma6394

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 avatar Nov 27 '17 21:11 elma6394

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

elma6394 avatar Nov 28 '17 14:11 elma6394

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

1rosehip avatar Nov 28 '17 15:11 1rosehip

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.

elma6394 avatar Nov 28 '17 15:11 elma6394

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

1rosehip avatar Nov 28 '17 15:11 1rosehip

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

elma6394 avatar Nov 28 '17 18:11 elma6394

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.

1rosehip avatar Nov 29 '17 08:11 1rosehip

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:

  • command: 'empty'
  • data-control-storage="false" on the boostrap paging ul
  • data-jump-to-start="true" on the boostrap paging ul

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

brendonwm avatar Dec 04 '17 03:12 brendonwm