-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I have a listbox with mold="paging".
I set pageSize="10" and have a model with 50 records in, so I see 5 pages.
The listbox have focus, so I can scroll with arrow keys on active page.
But when I press PgUp or PgDn on an active page I don't have a page change as I'm expecting.
PgUp works as Home key (goes at first record of active page) and PgDn works as End key (last record on active page).
I'm usign ZK 5.0.8.
Is this a bug or am I missing something?
Thanks for any answer.
This is the default behavior of Listbox. Unfortunately the Listbox component will not let you map PageUp/PageDn using the "ctrlkeys" property. I have done something similar using the Grid component.
Hope that helps.
/costas
But in zk demo the sample "keystroke commands" for listbox tells pgdn and pgup go to the next/previous page if any. So I expect this works. What is wrong? The demo sample or the listbox behaviour? Thanks for any answer.
Your are right about the demo. Maybe the zk team forgot to change the explanation or maybe this was a functionality provided in an older version.
/costas
Hi ggrimoldi,
Listbox currently not support paging with PageUp/PageDown,
you may post a feature request here,
and try the work around below:
<zk>
<listbox mold="paging" pageSize="2" xmlns:w="client">
<attribute w:name="_doKeyDown">
function (h) {
if (h.data.keyCode == 33) {
jq(this.$n('pgib')).find('.z-paging-prev').click();
h.stop();
} else if (h.data.keyCode == 34) {
jq(this.$n('pgib')).find('.z-paging-next').click();
h.stop();
} else
this.$_doKeyDown(h);
}
</attribute>
<listitem><listcell label="cell one" /></listitem>
<listitem><listcell label="cell two" /></listitem>
<listitem><listcell label="cell three" /></listitem>
<listitem><listcell label="cell four" /></listitem>
<listitem><listcell label="cell five" /></listitem>
</listbox>
</zk>
Asked: 2011-10-05 10:34:18 +0800
Seen: 151 times
Last updated: Oct 09 '11