Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

jtable page numbering #2406


User avatar
0
huntethan89 created

Hi, I am retrieving data from database and displaying using jtable. i am returing PagedResultDto which contaions 14188 records. So, I implemented paging on jtable. So it made 1419 pages . but it is not showing page number 1 and last page number 1419 in dropdown. It is displaying page number from 2 to 1418 in dropdown. Why it is not showing 1 and last page number.

This is jtable code -

_$EncumbranceListTable.jtable({ // title: app.localize('Builders List'), paging: true, sorting: true, multiSorting: true, actions: { listAction: { method: _EncumbranceListService.getEncumbranceList } },

        fields: {
            id: {
                key: true,
                list: false
            },

            actions: {
                title: app.localize('Actions'),
                width: '15%',
                sorting: false,
                display: function (data) {
                    var $span = $('<span></span>');

                    if (_permissions.edit) {
                        $('<button class="btn btn-icon btn-xs" title="' + app.localize('Edit') + '"><i class="fa fa-edit"></i></button>')
                            .appendTo($span)
                            .click(function () {
                                showhidedivs(0);
                                _EncumbranceListCompanies.html('<i class="fa fa-save"></i> Update');
                                updateEncumbranceListid = data.record.id;
                                getEncumbranceListinfo(data.record.id);
                            });
                    }

                    if (_permissions.delete) {
                        $('<button class="btn btn-icon btn-xs" title="' + app.localize('Delete') + '"><i class="fa fa-trash-o"></i></button>')
                            .appendTo($span)
                            .click(function () {
                                deleteUser(data.record);
                            });
                    }

                    return $span;
                }
            },

            encumbranceNumber: {
                title: app.localize('EncumbranceNumber')
            },
            descriptionShort: {
                title: app.localize('DescriptionShort')
            }
        }
    });

Thanks


1 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Jtable works this way. If you have a pageCount > 1000 and pageCount <= 2000, then it increases pagenumbers 2 by 2. See <a class="postlink" href="https://github.com/hikalkan/jtable/blob/master/lib/jquery.jtable.js#L3820">https://github.com/hikalkan/jtable/blob ... e.js#L3820</a>.

    So you will have page numbers like 2,4,6....,1418. If you have that much data, maybe you can use a textbox instead of combobox for goto page area, see <a class="postlink" href="http://www.jtable.org/ApiReference/GeneralOptions#genopt-gotoPageArea">http://www.jtable.org/ApiReference/Gene ... toPageArea</a>.