Filter variations for datatable

UI Components for JSF
Post Reply
rene.guenther
Posts: 56
Joined: 19 Oct 2009, 15:56

04 Dec 2009, 17:57

Hi ,

do you plan on adding pulldowns as a filter type(similar to excel)? That would be nice.
What I did so far is creating pulldown outside of the table. On change I call PrimeFaces.widget.DataTableUtils.filterColumn('tableName', this.value, 'columnName');

Filters outside of data table has of course some more advantages like keeping the value between different requests.
Regarding my current solution is there any way to get the full name of the column? Eg. with <p:column id="myColumn"> the column name was yui-dt0-myColumn.

Thanks
Rene

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

06 Dec 2009, 20:00

Hi Rene,

Yes, we were talking about this recently, this is something that'll be added along with ajax filter feature soon.

Column id has to be unique per datatable, if there're two datatables on same page then myColumn would be duplicate so we use the autogenerated yui datatable columns here.

So in summary, filtering will be revised very soon and custom controls/ajax filtering will be implemented.

rene.guenther
Posts: 56
Joined: 19 Oct 2009, 15:56

07 Dec 2009, 10:57

Hi Cagatay,

that sounds great. Unfortunately I dont know how to apply a filter with PrimeFaces.widget.DataTableUtils.filterColumn on page load, or to be more exact on data table load. Could you think of any way how I could achieve that? I tried with <body onLoad...> but that doesnt work in IE. It looks like that IE fires the onLoad event before the DataTable is rendered.

Cheers
Rene

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

08 Dec 2009, 15:01

I think you can achieve it easily with jquery as well instead of body onload, this approach is cross browser.

jQuery(document).ready(function() {
//your code
});

jQuery is added by PrimeFaces if you have datatable in page.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 22 guests