I could not find any tutorial regarding custom pagination in zk. ZK provides it’s default pagination and it’s quite good but my customer needs different pagination style. So, how can I create custom pagination in ZK. Any help please ?
I have a listbox like this :
<listbox id=”bidLbx” mold=”paging”>
<listitem>
...
</listitem>
</listbox>
It displays ZK’s default pagination like: 1 2 3 4 5 Next Last but with out option to select per page row number. So, I need my own Buttons and per page dropdown option.
You have to write the codes to control the pagination buttons as we require, i.e.
FirstPrevious12345NextLast.We just take reference of that id i.e.
bidLbxand do coding. We need to get certain values and use those values to control the buttons.This gives the current page no:
bidLbx.getPaginal().getActivePage();This gives the total number of rows:
bidLbx.getPaginal().getTotalSize();This sets the Page Size (i.e. no. of rows per page):
bidLbx.getPaginal().setPageSize();This gives the no. of pages:
bidLbx.getPaginal().getPageCount();and don’t forget to disable the default paging.
First button Example:
Dropdown perpage combobox:
If you have still problem do comment.