So when we put the model, it will automatically search it ? and automatically limit the data?
BenLimanto ( 2023-11-10 15:55:20 +0800 )edit-
FEATURED COMPONENTS
First time here? Check out the FAQ!
searchbox how to implement database search with huge data (more than 5000 values), client side search is very slow
Hey! So we also had the same issue in our implementation, some searchboxes have over 9k elements and searching was dead slow. I'm of the opinion that going back and forth between the client and the server will only slow it down. Looking at what made the client side so slow was the fact that ZK was trying to delete DOM objects that were not matching the criteria causing the DOM to recalculate. What I did instead was override this and instead just mark elements as invisible with CSS (display none). For us that is a huge improvement. Went down from a key stroke taking ~13 seconds on a 9K dataset to now being ~1 second (of course it now depends on the client, with firefox being noticeably faster)
There are several options:
see https://www.zkoss.org/wiki/ZKComponentReference/Input/Searchbox#Model
you can store all data in a SimpleListModel
, it will filter data at the server side
ListModelList
first,onSearching
and add the matched data into the ListModelList
So when we put the model, it will automatically search it ? and automatically limit the data?
BenLimanto ( 2023-11-10 15:55:20 +0800 )editAsked: 2023-09-21 11:35:43 +0800
Seen: 10 times
Last updated: Nov 17