p:datatable paginator - how to show just one?

UI Components for JSF
barak
Posts: 76
Joined: 22 Sep 2009, 16:39

14 Oct 2009, 15:40

Hi,

When using datatable paginator, 2 paginators displayed - above and below the table. Is it possible to display just one of them?

Thanks.

jekkil
Posts: 21
Joined: 11 Oct 2009, 13:23

14 Oct 2009, 15:41

I am interessted to know also the answer to this !

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

14 Oct 2009, 15:53

This has been requestes a couple of times as well, so in 1.0.0.RC we'll add options to defined which paginators will be visible. Until now you can hide the paginators simply with css;

Code: Select all

<style type="text/css">
#yui-dt0-paginator0{
 display:hidden;
}

#yui-dt0-paginator1{
 display:hidden;
}
</style>
This assumes you have only one datatable in your page, yui-dt0-paginator0 is located in header and yui-dt0-paginator1 is in footer. Again this is a workaround which would be added as a config option in 1.0.0.RC.

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

14 Oct 2009, 16:07

Hi,

I was just writing the same thing with Cagatay,

just a little update, each paginator has an unique id, so you do not need to have only 1 datatable in your page. You can have as many as you want. You can see your paginator id's from firebug or page source ;)

Yigit

barak
Posts: 76
Joined: 22 Sep 2009, 16:39

14 Oct 2009, 16:21

Tried this

Code: Select all

#yui-dt0-paginator0 {
    display:hidden;
}
and header paginator still displayed. I'm trying to find the paginator id in the page source, but the only references to "paginator" are the imported css/js files, and that:

Code: Select all

paginator:new YAHOO.widget.Paginator({rowsPerPage:10,totalRecords:174})
There is only one table in the page.

Can you help please?

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

14 Oct 2009, 16:36

Sorry typo;

Code: Select all

#yui-dt0-paginator0 {
    display:none;
}

User avatar
ydarcin
Posts: 258
Joined: 04 Jan 2009, 19:02
Location: Turkey

14 Oct 2009, 16:38

Hi,

I have just tested with:

Code: Select all

#yui-dt0-paginator0 {
    display:none;
}
and it seems ok,

also in page's source, please search for : yui-dt0-paginator0 so that there is a div with the id yui-dt0-paginator0

barak
Posts: 76
Joined: 22 Sep 2009, 16:39

14 Oct 2009, 16:56

I'm puzzeled :(

Can you please share the entire xhtml page with that change that works for you?

I found the div using firebug, however its style attribute is empty:

<div id="yui-dt0-paginator0" class="yui-dt-paginator yui-pg-container" style="">

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

14 Oct 2009, 16:57

This should work;

Code: Select all

#yui-dt0-paginator0 {
    display:none;
}

barak
Posts: 76
Joined: 22 Sep 2009, 16:39

14 Oct 2009, 17:05

Ok, missed the post announcing the typo... :-)

Solved.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 24 guests