datatable filter on each column but outside table

UI Components for JSF
grizli
Posts: 82
Joined: 11 Nov 2009, 16:36

17 Nov 2009, 21:50

So I see in showcase I can do a global filter or a filter by column.
I want to filter by column, but I want to put filter input fields outside <p:datatable> into accordion. Is this possible?
Thanks!

Loving PrimeFaces btw! :D

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

18 Nov 2009, 13:23

I guess it is possible, just copy and paste the rendered filter inputtexts to outside of datatable and set filter to false on column. A bit of an hack but will work. ;)

grizli
Posts: 82
Joined: 11 Nov 2009, 16:36

18 Nov 2009, 17:02

ok, i set each column to filter="true" but it won't output a filter on any of the columns.
I also have sortyBy and sortable="true" set on each column. Will filter not work when sorting is enabled?

grizli
Posts: 82
Joined: 11 Nov 2009, 16:36

18 Nov 2009, 17:03

i removed scrollable="true" from p:dataTable and it rendered the filter.
Is scrollable not compatible with filters? :(

btw, i also don't see where it renders input elements when filter is on. All I see is
key:'j_id16',label:'Name',sortable:true,filter:true for each item.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Nov 2009, 16:45

I need to check filter compatibility with scrollable table, if it's not working it needs to be fixed.

Filter inputs are dynamically added with javascript, not from markup.

grizli
Posts: 82
Joined: 11 Nov 2009, 16:36

19 Nov 2009, 16:56

So if filter inputs are added with javascript, how can I do that:
I guess it is possible, just copy and paste the rendered filter inputtexts to outside of datatable and set filter to false on column. A bit of an hack but will work.
Seems like scrolling is not available when filtering. Do you think this could be fixed in the upcoming 1.0.0 release? :)

Thanks so much!

PS: Btw, is 23rd still the date?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

19 Nov 2009, 18:25

Hopefully improved filtering will be in 1.0.0 if not in 1.0.0.RC. What I meant was first use firebug to see the dom tree, find out the javascript rendered(onclick event of inputs) than set filter to false on columns, create your own input fields with onclick attribute as the onclick event you've fetched from datatable. This is far from ideal and not scalable but should work. Onclick filter of inputs are something like;

<input type="text" onkeyup="PrimeFaces.widget.DataTableUtils.filterColumn('j_id23', this.value, 'yui-dt1-col-j_id24')"/>

Still I'd prefer filter="true" option, placing filters outside of datatable requires this hacks.

grizli
Posts: 82
Joined: 11 Nov 2009, 16:36

19 Nov 2009, 20:19

I appreciate all the support!
I'll wait for 1.0.0rc, thanks again :)

grizli
Posts: 82
Joined: 11 Nov 2009, 16:36

10 Feb 2010, 17:10

Hi Cagatay,
Is taking filters outside the table and putting it say under Accordion will be possible with the most recent version?
What I'd like to do is to allow a user enter multiple filters before the data is returned. Maybe allow fill out 2-3 fields and then click a Filter button.
Btw, what is the best approach to filter not only on fields displayed in the table, but also other data? The data comes from a database (ArrayList is populated from the DB)
I'd appreciate any pointers on how to best accomplish this with PrimeFaces.
Thanks again!

grizli
Posts: 82
Joined: 11 Nov 2009, 16:36

11 Feb 2010, 22:50

Should I hope for a response? I promise I'm not trying to be annoying, just curious if I will get some help :)

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 47 guests