• Resolved Jardry

    (@jardry)


    Is it possible to add a TAB with the ability to set default settings for Table Options and Features of the Database Javascript Library?

    The current default settings I’m changing are:

    NOT to alternate row colours
    NOT allow visitors to sort
    NOT allow visitors to search
    NOT have pagination

    Having had to import a number of tables, this became a little frustrating.

    Thank you for considering my request.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your post, and sorry for the trouble.

    I see what you mean. Currently, I don’t have plans to add a tab that allows changing the defaults — but, there’s a good and easy code solution for you. For example, add this to the end of your theme’s “funtions.php” file:

    add_filter( 'tablepress_table_template', 'jardry_change_tablepress_default_table_settings', 11 );
    function jardry_change_tablepress_default_table_settings( array $table ) {
      $table['options']['alternating_row_colors'] = false;
      $table['options']['use_datatables'] = false;
      return $table;
    }

    Regards,
    Tobias

    Thread Starter Jardry

    (@jardry)

    Hi Tobias,

    Thank you for your prompt response and solution.
    Its prefect for my needs.

    Regards

    Jardry

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    no problem, you are very welcome! 🙂 Good to hear that this helped!

    Best wishes,
    Tobias
     
    P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Set Default Table Settings’ is closed to new replies.