Closed (fixed)
Project:
DataTables
Version:
7.x-1.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Reporter:
Created:
31 May 2012 at 13:31 UTC
Updated:
1 Jul 2014 at 11:54 UTC
Jump to comment: Most recent
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.
| Comment | File | Size | Author |
|---|---|---|---|
| default_value_for_display_length.patch | 755 bytes | howto |
Comments
Comment #1
duellj commentedFixed in commit http://drupalcode.org/project/datatables.git/commit/e582a0c
Comment #2.0
(not verified) commentedFix some typo