cancel
Showing results for 
Search instead for 
Did you mean: 

Table filter like Excel

Former Member
0 Kudos

Hi All,

I have a little unusual requirement. Usually when we implement a filter for the table it shows up on the top as an input field. User can enter the filter string and the filtered data shows up in the table.

Now my requirement is to develop a filter that is similar to the one we have in Excel. Users should be able to select multiple filter string and the result should be based on those filter string. For ex. in a column if there are 3 types of values - High, Medium and Low, and I want a filter, that will show only High and Low rows in the table. It would have been really easy if we had an option to place a UI (say Dropdown) as a filter. So, on the onSelect event we could open a popup windows with all the filter strings. But unfortunately its not how WDJ is designed.

As a work around I thought of placing a table with a header and one row (with filter UIs) on top of a headerless table (data table), something like a sandwich. Since they are two individual tables, if a user wants to change the column width, both the tables will be out of sync. So i dropped that idea. Popin UI i guess will also behave the same.

Please provide your inputs too. If you have any doubts regarding the requirements please let me know.

Regards,

Piyush.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member197472
Active Participant
0 Kudos

My suggestion will be to create one button on toolbar of table , say named as Filter

Open popup on click of it .. get filter values and on submit fire filter code.

Former Member
0 Kudos

Hi Amey,

Thanks for the help. I was able to convert the InputField as a Combo box using below code.

IProposalList proposalsCity = wdContext.nodeMyNode().getNodeInfo().getAttribute(IPrivateMyView.IMyNodeElement.CITY).getModifiableSimpleType().getSVServices().getProposals();

proposalsCity.add("New York");

proposalsCity.add("Rio");

proposalsCity.add("Paris");

proposalsCity.add("x");


So when a user selects/types 'X' and press enter, a popup window will show up with all the filter values.


Now I want to know which column triggered the filter event. I am sure

table.mappingOfOnFilter().addSourceMapping(); can do the trick. But I am trying to figure out how it works.


Please provide your inputs.


Regards,


Piyush.


former_member197472
Active Participant
0 Kudos

Great !!

Can you try following link ?.. It will take combinaiton of filters.. I dont think there is need of checking column mapping.. Just Bind your simple type to filter attribute .. I havent tried it yet but i think it will do the job ..