Hey there, Awesome Customers!

Just a heads up: We'll be taking a breather to celebrate International Workers' Day (May 1st and 2nd - Wednesday and Thursday) and Orthodox Easter from Good Friday (May 3rd) through Easter Monday (May 6th). So, from May 1st to May 6th, our team will be off enjoying some well-deserved downtime.

During this time, our customer support will be running on a smaller crew, but don't worry! We'll still be around to help with any urgent matters, though it might take us a bit longer than usual to get back to you.

We'll be back in action at full throttle on May 7th (Tuesday), ready to tackle your questions and requests with gusto!

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find loads of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel). These gems might just have the answers you're looking for while we're kicking back.

Thanks a bunch for your understanding and support!

Catch you on the flip side!

Warm regards,

TMS

Okay
  Public Ticket #2660870
Request for Roadmap - Ability to manage number of items per table
Closed

Comments

  • Alex started the conversation

    Hi, I would like to request feature to be added to roadmap. 

    Problem: At the moment, there is no option to customize number of results per page as only default given 5,10, 25, 50, ..., all. When providing data services for clients under membership model , it is handy to limit this functionality. However, with small numbers up to 25-50 it is ok but you do not want to give ALL and in tables with more than couple of hundred thousands record it breaks.

    Value: 

    • fix error when all selected on big tables
    • give flexibility to provide own custom number for aligning with memberships


  •  2,499
    Aleksandar replied

    Thanks for the suggestion, Alex, I will forward it to our development team.

    You can't use this option out-of-the-box, but there's a way to do it.

    You need to open this file: ../wp-content/plugins/wpdatatables/templates/admin/table-settings/table_settings_block.inc.php and around line 335 you'll see this:

    <select class="form-control selectpicker" id="wdt-rows-per-page">
       <option value="1">1</option>
       <option value="5">5</option>
       <option value="10">10</option>
       <option value="25">25</option>
       <option value="50">50</option>
       <option value="100">100</option>
       <option value="-1"><?php _e('All', 'wpdatatables'); ?></option>
    </select>

    You can replace the last option (All) with the 1000 option, like this:

    <select class="form-control selectpicker" id="wdt-rows-per-page">
       <option value="1">1</option>
       <option value="5">5</option>
       <option value="10">10</option>
       <option value="25">25</option>
       <option value="50">50</option>
       <option value="100">100</option>
       <option value="1000">1000</option>
    </select>
    

     And you'll have that option in the "Display" tab above the table:

    7120173477.png

    Then, open ../wp-content/plugins/wpdatatables/source/class.wpdatatable.php and around line 3207, and replace "All" with 1000, so it looks like this:

    $obj->dataTableParams->aLengthMenu = json_decode('[[1,5,10,25,50,100,1000],[1,5,10,25,50,100,1000]]');
    

    And the last thing to do is to go to line 499 of the same file, and modify it so it looks like this:

    public function setDisplayLength($length) {
            if (!in_array($length, array(1, 5, 10, 20, 25, 30, 50, 100, 200, 1000))) {
                return false;
            }
    

    So, again, replace -1 with 1000.

    You may also want to add the value in ../wp-content/plugins/wpdatatables/templates/admin/table-settings/column_settings_panel.inc.php around line 570, if you wish to add that value to possible column options (if you have a select-box filter, or selectbox editor input type, this would be the number of values displayed in those drop-downs).

    Please make sure to delete cache in your browser after you apply the changes.

    This removes the ALL option, but you can freely add new values in there.

    Kind Regards, 

    Aleksandar Vuković
    [email protected]

    Rate my support

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables