From 68aab2bfc20233391f5be7d5ae25142aa2a987c0 Mon Sep 17 00:00:00 2001 From: mokaddem Date: Wed, 25 Mar 2020 10:25:21 +0100 Subject: [PATCH] chg: [genericElement:IndexTable] Allow to pass pagination options to paginator element --- .../Elements/genericElements/IndexTable/index_table.ctp | 7 ++----- .../Elements/genericElements/IndexTable/pagination.ctp | 4 ++-- app/View/GalaxyClusters/ajax/index.ctp | 3 +++ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/View/Elements/genericElements/IndexTable/index_table.ctp b/app/View/Elements/genericElements/IndexTable/index_table.ctp index fcd6266f7..e64cade99 100644 --- a/app/View/Elements/genericElements/IndexTable/index_table.ctp +++ b/app/View/Elements/genericElements/IndexTable/index_table.ctp @@ -26,11 +26,8 @@ } $skipPagination = isset($data['skip_pagination']) ? $data['skip_pagination'] : 0; if (!$skipPagination) { - $paginationData = array(); - if (!empty($data['paginationBaseurl'])) { - $paginationData['paginationBaseurl'] = $data['paginationBaseurl']; - } - echo $this->element('/genericElements/IndexTable/pagination', $paginationData); + $paginationData = !empty($data['paginatorOptions']) ? $data['paginatorOptions'] : array(); + echo $this->element('/genericElements/IndexTable/pagination', array('paginationOptions' => $paginationData)); } if (!empty($data['top_bar'])) { echo $this->element('/genericElements/ListTopBar/scaffold', array('data' => $data['top_bar'])); diff --git a/app/View/Elements/genericElements/IndexTable/pagination.ctp b/app/View/Elements/genericElements/IndexTable/pagination.ctp index 1c084e781..b5e3db24a 100644 --- a/app/View/Elements/genericElements/IndexTable/pagination.ctp +++ b/app/View/Elements/genericElements/IndexTable/pagination.ctp @@ -5,8 +5,8 @@ 'before' => '$(".progress").show()', 'complete' => '$(".progress").hide()', ); - if (!empty($paginationBaseurl)) { - $options['url'] = $paginationBaseurl; + if (!empty($paginationOptions)) { + $options = array_merge($options, $paginationOptions); } echo $this->Paginator->options($options); echo sprintf( diff --git a/app/View/GalaxyClusters/ajax/index.ctp b/app/View/GalaxyClusters/ajax/index.ctp index dab93b95c..0007a8a25 100644 --- a/app/View/GalaxyClusters/ajax/index.ctp +++ b/app/View/GalaxyClusters/ajax/index.ctp @@ -1,6 +1,9 @@ element('/genericElements/IndexTable/index_table', array( 'data' => array( + 'paginatorOptions' => array( + 'update' => '#clusters_div', + ), 'data' => $list, 'top_bar' => array( 'children' => array(