Okay
  Public Ticket #1761830
Limiting the total number of Rows that can be displayed/exported
Closed

Comments

  •  5
    James Morley started the conversation

    I can see how I change the total number of Rows displayed on first load, but is it possible to change the values that appear in the selector on the front end? Currently it has 1,5,10,25,50,100,All but I would like 10,50,100,500,1000 (and specifically with no 'All' option as I have 90,000+ rows).

    Additionally, is there a way to enable a larger (or indeed complete) export but without having to display more records - it only outputs the current view (I guess because it is using the page data rather than making another query to the database) but i think user expectation, at least in my use case, is for the full set.

  • [deleted] replied

    Hi James,

    This could be done but it require code customization. If you are skillful with code i can point you to the right direction or you can hire one of our developer to help you with this. Please keep in mind that code customizations are not covered with updates so you will need revert it after every update.

    Unfortunately exporting large dataset is really slow so the library that we are using for the frontend discourage users to use it which means that it would require writing a custom solution that will generate files on the server rather then on the frontend 


  •  5
    James Morley replied

    Hi Miljko

    Thanks for this. I did have a poke around in the code but at a first glance couldn't find it - if you are able to point me in the right direction I am sure I can work out how to amend it. I did also think - which would avoid the potential problem with codebase updates, that i could probably just use a bit of jQuery to inject new values after page load, but that feels too much of a hack and it would be better to adjust the source!

    For the full export, I'll likely just write a small php helper script that takes the variables and does a direct query of the db, then modify the behaviour of the buttons. I can't imagine it will be too hard.


    Best, James

  • [deleted] replied

    Hi James,

    To be able to choose one of the option that you want to add as a default in table settings please find 

    ..wp-content/plugins/wpdatatables/templates/admin/table-settings/table_settings_block.inc.php:331

    There is a select HTML element which needs to be updated with new values.

    In

    ../wp-content/plugins/wpdatatables/source/class.wpdatatable.php

     you need to update setDisplayLength and in getJsonDescription to update aLengthMenu parameter.