Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search result reset after add single item or add all #85

Open
loiaconoa opened this issue Jan 23, 2023 · 3 comments
Open

Search result reset after add single item or add all #85

loiaconoa opened this issue Jan 23, 2023 · 3 comments

Comments

@loiaconoa
Copy link

When a search is applied, selecting an item by clicking on it or adding all searched items, the list is updated and it's showing alle the items.
Also, by clicking add all, all items are moved, without regarding the filter.

@krognome
Copy link

I second this. It would be a nice fix to have the search run again after each time user adds or removes options from one list to the other. Right now it leaves the search query in the box but removes the search results so to add to the code to have the filter run again if search query is not empty? Maybe add it to the redraw method if search input not empty run filter method for either side?

@horkam
Copy link

horkam commented Feb 16, 2024

@loiaconoa @krognome
I dug into it a bit because I really wanted it to work. If you want to go through the trouble of keeping the code local to your server you can edit the source redraw function then rebuild:

    /**
     * Redraws the Dual listbox content
     */
    redraw() {
        this.options.sort(this.sortFunction);

        this.updateAvailableListbox();
        this.searchLists(this.search_left.value, this.availableList);
        this.updateSelectedListbox();
        this.searchLists(this.search_right.value, this.selectedList);
        this.syncSelect();
    }

Works a treat for me now.

@krognome
Copy link

I'll update my codebase with this. Thanks :). I have it on my list to add in pagination of some sort because right now I'm loading in all 4,000 clients so it's a memory hog and a little slow for my client bc their machine does not have much memory. Thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants