jQWidgets Forums

jQuery UI Widgets Forums Grid disabling page options without disabling paging

This topic contains 5 replies, has 2 voices, and was last updated by  Peter Stoev 12 years, 5 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author

  • DaveC426913
    Member

    In the paginator, I do not wish to give the user the option of how many results to show per page; I wish to fix results at 20.

    I can functionally fix it at 20 easily enough, but now that I no longer have a use for the ‘show rows: [20 v]’ control in the paginator, so I want to hide/remove it.

    I still need the ‘go to page’, the ‘1-20 of 20’ and the ‘< >’ arrows. so I can’t simply set pageable to false.

    I suspect the answer is to make a custom paginator template, identical to the default paginator, and simply leave out the undesired control, yes?

    Can someone point me at the template as it is built by default so I can copy it?


    DaveC426913
    Member

    To be clear, there is an example pagerrenderer template here:
    http://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/index.htm#demos/jqxgrid/paging.htm

                var pagerrenderer = function () {
    var element = $("<div style='margin-top: 5px; width: 100%; height: 100%;'></div>");
    var paginginfo = $("#jqxgrid").jqxGrid('getpaginginformation');
    for (i = 0; i < paginginfo.pagescount; i++) {
    var anchor = $("<a style='padding: 5px;' href='#" + i + "'>" + i + "</a>");
    anchor.appendTo(element);
    anchor.click(function (event) {
    var pagenum = parseInt($(event.target).text());
    $("#jqxgrid").jqxGrid('gotopage', pagenum);
    });
    }
    return element;
    }

    but it is too simple. Mine is identical to the default except for the one exchange I want. So I’m looking for the default template.


    DaveC426913
    Member

    I am still needing an answer to this. Can’t figure out how to configure it via widget API or modify this manually via jquery.


    Peter Stoev
    Keymaster

    Hi DaveC426913,

    You can use only the pagerrenderer function for customization of the pager.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com


    DaveC426913
    Member

    Yes. Unfortunately, I don’t have an example of a pagerrenderer to start from. Ideally, I’d like to find an example that build it exactly as it is by default, then I can modify as I see fit. I think starting from scratch (or from the above, highly simplistic example) will be very difficult.


    Peter Stoev
    Keymaster

    Hi DaveC426913,

    There are 2 examples using the pagerrenderer. The first one is available in the Demos section of the site in the Grid demos, the second one is available in the help documentation about jqxGrid.

    Best Regards,
    Peter Stoev

    jQWidgets Team
    http://www.jqwidgets.com

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.