question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow "All" to the data-page-list

See original GitHub issue

Hi,

I know there is the toggle pagination, but it would be much easier and cleaner (most importantly cleaner). I have to many buttons as it is and would be much better if I can do exactly what the toggle pagination button does, but using an All option in the data-page-list. e.g. data-page-list="[5, 10, 20, 50, 100, ALL]"

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:26 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
Ericzhiluocommented, Jul 7, 2017

The NaN issue is caused by djhvscf’s commit. The added functionality did not consider multi-language. It will only work for en-US. To fix this, simply go to your bootstrap-table-locale-all.js file and find the languages that you are using, and add formatAllRows: function () { return 'All'; } to the bottom. However, if you want to show the translated word for “All” in the button, you need to return the translated word. If you use Chinese, for example, you will be returning “全部” instead and data-page-list need to become data-page-list="[10, 25, 50, 100, 全部]"

@wenzhixin, this is clearly a bug, please take a look at it and fix it when you have time.

An example:

$.fn.bootstrapTable.locales['zh-CN'] = {
        formatLoadingMessage: function () {
            return '正在努力地加载数据中,请稍候……';
        },
        formatRecordsPerPage: function (pageNumber) {
            return '每页显示 ' + pageNumber + ' 条记录';
        },
        formatShowingRows: function (pageFrom, pageTo, totalRows) {
            return '显示第 ' + pageFrom + ' 到第 ' + pageTo + ' 条记录,总共 ' + totalRows + ' 条记录';
        },
        formatSearch: function () {
            return '搜索';
        },
        formatNoMatches: function () {
            return '没有找到匹配的记录';
        },
        formatPaginationSwitch: function () {
            return '隐藏/显示分页';
        },
        formatRefresh: function () {
            return '刷新';
        },
        formatToggle: function () {
            return '切换';
        },
        formatColumns: function () {
            return '列';
        },
        formatAllRows: function () {
            return 'All'; // or return your translated word "全部"
        }
    };
2reactions
critt3rscommented, Oct 4, 2016

I have the same situation like @dHumanities , when set the locate language to en-US language, data-page-list=“[5, 10, 15, 20, ‘All’]” will work fine. But when i change to ms-MY, the ‘All’ will show as NaN.

Does page-list=“[5, 10, 15, 20, ‘All’]” only work with en-US? I think it will be the same with other Local language setting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use case: Loading data into a page list property - Pega
This allows the data page to create instances of itself that hold full or minimal product detail, depending on the value of param.DetailLevel...
Read more >
javascript - Bootstrap Table Page List Not Working,Why Hide ...
Please find below mentioned solution. You have to add quotes in ALL. pageList: [10, 25, 50, 'ALL']. Let me know if it not...
Read more >
Table Options - Bootstrap Table
Attribute: data-page-list · Type: Array · Detail: When setting the pagination property, initialize the page size by selecting the list. If you include...
Read more >
PEGA Dropdown Box Data Page List Source - YouTube
Key moments. View all · Key moments · Description · Key moments. View all · Comments 16 · Transcript ...
Read more >
PEGA Configuring Rest Connector Step By Step - YouTube
All About Pega. Nikita Kanoria. Nikita Kanoria. •. •. Updated 3 days ago · Rest API Basic - Part#1. PEGAhut. PEGAhut.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found