0

search in grid

asked 2015-01-21 09:38:51 +0800

anetkia102 gravatar image anetkia102
21 1

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.

delete flag offensive retag edit

Comments

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 )edit

yes 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

3 Answers

Sort by ยป oldest newest most voted
0

answered 2015-01-21 17:32:05 +0800

terrytornado gravatar image terrytornado flag of Germany
9393 3 7 16
http://www.oxitec.de/

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.;-)

link publish delete flag offensive edit
0

answered 2015-01-25 16:47:14 +0800

Darksu gravatar image Darksu
1991 1 4

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

link publish delete flag offensive edit
0

answered 2015-01-29 17:03:43 +0800

anetkia102 gravatar image anetkia102
21 1

Thank you all - will definitely test your suggestions and come back with results

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-01-21 09:38:51 +0800

Seen: 33 times

Last updated: Jan 29 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More