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

del multiply items is not allowed? #201

Closed szxraul closed 8 years ago

szxraul commented 8 years ago

Everytime I update list-items, I need a 'While' to del the existing items, that's really awful. Or there is another method I dont know.

1rosehip commented 8 years ago

Have you tried this API? http://jplist.com/documentation/api#api-remove-items

szxraul commented 8 years ago

Yes,the API I am using is the one you mentioned.But it could only remove one item with one run.

while($('.list-item').html()){ $('.know-chart-content').jplist({ command: 'del', commandData: { $item: $('.list-item') } }); }

the above is the code in my project to update the data-item.

1rosehip commented 8 years ago

Please use $items instead of $item:

$demo.jplist({
      command: 'del'
      ,commandData: {
         $items: $('.your-item-path')  //select your items using jQuery
      }
});

http://jplist.com/documentation/api#api-remove-items

szxraul commented 8 years ago

Thanks a lot. I'm very grateful for your project. Here is another question. The HTML is paginationed. So We can hardly select the whole items We had pushed in the storage. The click event binded on the page number would not be changed. I hope that there is a 'Update' method which automaticly clears the storage and push the new data-items.

1rosehip commented 8 years ago

Are you asking if local storage is updated after pagination button is clicked? If so, the answer is yes. The local storage is updated after each action of every control (sorting, pagination, filtering etc.). Of course local storage should be enabled in settings.