Tooltips for the buttons in paging in grid

asked 2017-12-13 22:13:52 +0800

Rish gravatar image Rish
101 2

updated 2017-12-15 01:34:49 +0800

Hello, folks!

It is possible to add tooltips to the buttons in paging in grid?

In fact, I've managed to add them at the moment the page in loaded. But they disapear after navigating by paging. That is an auto paging with mold "paging" in grid. Should I place <paging> in zul and rewrite paging work to add tooltips on onPaging event?

I also don't want to show paging when elements fit in one page.

public void afterCompose(@ContextParam(ContextType.VIEW) Component view) {
    // ...

def tunePagingTooltips() {
    def script = "setTimeout(function(){\$(\".z-paging-prev\").attr(\"title\",\"Previous page\");\n" +
            "      \$(\".z-paging-next\").attr(\"title\",\"Next page\");\n" +
            "      \$(\".z-paging-first\").attr(\"title\",\"First page\");\n" +
            "      \$(\".z-paging-last\").attr(\"title\",\"Last page\");\n" +
            "      msgzk.GOTO_ERROR_FIELD=\"Close\" \n" +
            "      \$(\".z-paging-inp\").attr(\"title\",\"Enter page number\");}, 100);"

Thanks in advance.

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted

answered 2017-12-14 10:26:48 +0800

cor3000 gravatar image cor3000
6168 2 7
ZK Team

updated 2017-12-14 10:28:01 +0800

about automatically hiding the paging control:

This is enabled by default. If you disabled it globally you can set a custom attribute inside the grid component to enable/disable it for a single grid:

example: http://zkfiddle.org/sample/3g34pf9/2-autohide-paging

link publish delete flag offensive edit

answered 2017-12-14 10:55:02 +0800

cor3000 gravatar image cor3000
6168 2 7
ZK Team

you can access the auto created paging component via grid.getPagingChild())

The you can add a client side widgetListener "onBind" to execute a script always when this widget is recreated (e.g. after paging)

As demonstrated in this zkfiddle example Please note this example uses the CSS classes for ZK 7+ as you tagged this question as 7.0.2 (e.g. .z-paging-prev was renamed to .z-paging-previous since ZK 7)

Please always be precise when posting questions.

link publish delete flag offensive edit


Thank you very much for both your answers! The given example worked fine.

I also pointed wrong version, it is 7.0.0 actually. I've updated my post, thank you again.

As for the attribute it is '.z-paging-previous' in my listbox but it is '.z-paging-prev' in my grid.

Rish ( 2017-12-15 01:57:48 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools




Asked: 2017-12-13 22:13:52 +0800

Seen: 12 times

Last updated: Dec 15 '17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More