please help me on providing the FILTER functionality to the Grid or any table like components

asked 2009-11-19 12:31:37 +0800

ravi526 gravatar image ravi526

Hi Friends.

Is ZK provides auto filter functionality with Grid or some other inbuilt table kind of component [i.e. listbox etc].
What I am looking is, if Grid has large number of rows and if we want to see only particular value rows then there should be some drop down box with list of unique column entries [For example if we have column by the name COUNTRIES, it may have thousands of rows but with limited number of countries like USA, CANADA, CHINA, INDIA, MEXICO etc. If we have select box with above 5 countries values, then once we select any country, then gird rows should be filtered i.e. Grid should display only rows that has selected country value]

We can get similar kind of functionality by means of GROUP in column default menu popup [after setting it AUTO]. But in this it will group all the rows and display all the rows with group subtitle, But I am looking only the rows selected by user but not all.

Please help me on this

delete flag offensive retag edit

4 Replies

Sort by ยป oldest newest

answered 2009-11-19 12:57:06 +0800

YamilBracho gravatar image YamilBracho
1722 2

Do this:
1) Fill the combo box with the countries
2) Add a button to "filter" the detail grid/ListBox
3) In the OnClick of the button "filter" do the SQL filter taking the selected value from the combo box
4) Fill the grid/ListBox with the found values

link publish delete flag offensive edit

answered 2009-11-19 13:05:55 +0800

ravi526 gravatar image ravi526

Hi yamilBracho

thanks for quick reply
I had given countries just as an example to inform the forum what I am looking for.
Actually we have a ZK web application where reports will be generated on fly by reading definition from data base. I mean all definitions are dynamic.
If I follow the approach suggested by you, I believe it will work only specified column and I need to code all logic.
But I want to use ZK in-built features if it has any.

You can find the same functionality in microsoft excel sheet.
Open any excel sheet which has few rows and few columns and select any cell, then
go to Menu ->Data->Filter->Auto Filter
Then you will see column headers appeared with small DOWN ARROW marks. If we click it we will get list of unique column entries and SHOW ALL option. If we select an element from this list box , then excel will display only those rows, but not all
In other way you can check the web app developed by using java script given below

I am looking same functionality as of above from ZK inbuilt features.

link publish delete flag offensive edit

answered 2009-11-19 14:22:33 +0800

YamilBracho gravatar image YamilBracho
1722 2

By "inbuilt" you mena databinding ?
If so, you only need to manipulate the model of your grid/listbox

link publish delete flag offensive edit

answered 2009-11-19 14:32:05 +0800

ravi526 gravatar image ravi526

sorry for confusion
in built means-- by using zk features
for example menupopup=auto, it will give default sorting, and also grouping etc

link publish delete flag offensive edit
Your reply
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




Asked: 2009-11-19 12:31:37 +0800

Seen: 553 times

Last updated: Nov 19 '09

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