Skip to content

Commit 0e3acdf

Browse files
DataTable charts - Infinity Pagination
1 parent fc137c1 commit 0e3acdf

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

classes/Visualizer/Render/Sidebar/Type/DataTable/DataTable.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ protected function _renderTableSettings() {
176176
'pageLength_int',
177177
$this->pageLength_int,
178178
esc_html__( 'The number of rows in each page, when paging is enabled.', 'visualizer' ),
179-
'10'
179+
10,
180+
'number',
181+
array( 'min' => 1 )
180182
);
181183

182184
echo '<div class="viz-section-delimiter section-delimiter"></div>';

js/render-datatables.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,9 @@
140140
if(parseInt(valoo) > 0){
141141
valoo = parseInt(valoo);
142142
}
143+
if(i === 'pageLength' && (valoo === '' || parseInt(valoo) < 0)){
144+
valoo = 1;
145+
}
143146
}
144147

145148
// if the setting name has an '_' this means it is a sub-setting e.g. select_items means { select: { items: ... } }.

0 commit comments

Comments
 (0)