0

On a custom control I have a repeat control which iterates over a vector. This repeat control does have a pager bound to it. I want to hide the previous and next links when the pager is on the first or on the last page of the control.

To hide the previous is ofcourse easy >> Add a rendered property to getpageCount() > 0. The next link is a bit of a problem. The pager class does not have a method getCurrentPage(). therefore I can't find out which page I'm currently at on the pager.

Is there someone who does have a fix / idea on how to hide/show the next / previous links on a pager using SSJS?

4

2 に答える 2

3

ベクトルでアイテムの数を取得できます(A)リピートコントロールの1ページに表示するアイテムの数もわかっています(B)したがって、ページの総数はmod(A / B)+1になります。そのページにいる場合は、次のボタンを非表示にすることができます。

Mod(モジュロ)は、小数部または整数除算をスキップすることを意味します。

于 2012-05-07T17:46:44.647 に答える
0
document.getElementById("#id:pager2}").firstChild.nextSibling.lastChild.lastChild.textContent)

Try the above, Actually above is for getting the value of the Group's value of last element.

I guess that using the client side javascript has more easier than SSJS for manipulating the DOM tree,

Here, We have <previous><Group><Next>, 

So we need to get the second element .And it is a span tag. I am getting the lastChild of lasChild.

Note: Do not hide it by setRendered(true). Because after that DOM tree will loose its children. Use display:none property.

于 2012-05-08T09:36:08.393 に答える