javve / list.js

The perfect library for adding search, sort, filters and flexibility to tables, lists and various HTML elements. Built to be invisible and work on existing HTML.
https://listjs.com
MIT License
11.2k stars 898 forks source link

problem use the function with the `item:` option. #698

Open machupichu123 opened 3 years ago

machupichu123 commented 3 years ago

I found a problem use the function with the item: option.

I can't update using .values.

For example, here is the code. https://jsfiddle.net/pr38udgc/

I can update by writing HTML in the item: option, However, in the case of I can not update if I use a function getHtml.

I'm searching for 'Lucy', but when I write the getHtml for item: option, result shows 'Ernest Miller-Hemingway'.

In contrast in the case of I use HTML for item: option result shows 'Lucy Maud Montgomery' correctly.

So the userList object has been updated, but only the HTML doesn't seem to be updated.

devgianlu commented 3 years ago

I am having the same issue, did you eventually figure this out? I might dig in the source code to fix it otherwise.

devgianlu commented 3 years ago

The current workaround is to set elm to undefined and then call update() on the list.

https://jsfiddle.net/smvhdaq3/