When i config the views display "datatables", i can get default value that i have config at the "PAGINATION AND PAGE LENGTH
\ Default Page Length" but this config seem to be saved to database and effect in the view result.

I walk a round the code in file "datatables_style_plugin.inc":

$form['pages']['display_length'] = array(
      '#type' => 'select',
      '#title' => t('Default Page Length'),
      '#default_value' => !empty($this->options['pages']['display_length']),
      '#options' => array(10 => 10, 25 => 25, 50 => 50, 100 => 100),
      '#description' => t('Default number of records to show per page. May be adjusted by users if Length Selection is enabled'),
);

You used the function "empty()" to set the "#default_value"?
I change the "#default_value" to '#default_value'=>$this->options['pages']['display_length'];
then it work ok.

CommentFileSizeAuthor
default_value_for_display_length.patch755 byteshowto

Comments

duellj’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Fix some typo

  • duellj committed e582a0c on 7.x-1.x, 7.x-2.x
    Issue #1611528 by howto, duellj - Fixes default value for page length