-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Hello All, Any suggestion would be great. My environment: MySQL, Eclipse, Tomcat. Data from MySQL table are displayed in Grid component. The challenge now is to implement search functionality - ideally in a popup window: User clicks search, popup window is being displayed, the user can enter an id (first column in a grid) and when its found its being highlighted in a grid.. I did a loop to go through grid - and for now just print the founded row - its now working though: for (Component row: rows.getChildren()) { if (row.getId() == value) { System.out.println("found our row"); } } Any suggestions please? Thank you.
Try to search in the MODEL not in the rendered grid.
If found i think there is something like selected(). Than ZK will select the item in grid.
Sorry, i'm at tablet by sports.;-)
Hello anetkia102,
In addition you could highlight the matched items as shown in the post below:
http://forum.zkoss.org/question/59295/highlight-item-in-listbox-from-javascript/
Best Regards,
Darksu
Thank you all - will definitely test your suggestions and come back with results
Asked: 2015-01-21 09:38:51 +0800
Seen: 33 times
Last updated: Jan 29 '15
ctrl + f => find in browser, type your word and browser will highlight it. I'm like Terry, put filters above your grid and refine the search.
chillworld ( 2015-01-21 19:05:15 +0800 )edityes I'd definately recommend refining the model or searching in the model (http://books.zkoss.org/wiki/ZKDeveloper%27sReference/MVC/Model/List_Model). As then you can still find/select the record independently of row.getId(). If you need to use <listbox> instead of <grid> for row selection.
cor3000 ( 2015-01-22 01:14:02 +0800 )edit