Skip to content

Commit 8b2a221

Browse files
committed
Fix issue with pagination in bookmark grid
1 parent 90d02bf commit 8b2a221

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

Component/Form/FormViewModel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ public function getButtons(): array
8888
return [
8989
$this->buttonFactory->createCloseAction(),
9090
$this->buttonFactory->createSaveCloseAction(),
91-
//$this->buttonFactory->createSaveContinueAction(), // @todo: This looses current changes when creating a new item
91+
// @todo: This looses current changes when creating a new item
92+
//$this->buttonFactory->createSaveContinueAction(),
9293
];
9394
}
9495

Component/Grid/GridViewModel.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,12 +150,20 @@ public function getJsComponentName(): ?string
150150

151151
public function getJsData(): array
152152
{
153+
$columns = $this->getColumns();
154+
$stateData = $this->getState()->toArray();
155+
if (empty($stateData['activeColumns'])) {
156+
foreach ($columns as $column) {
157+
$stateData['activeColumns'][] = $column->getCode();
158+
}
159+
}
160+
153161
return [
154162
...parent::getJsData(),
155-
...$this->getState()->toArray(),
163+
...$stateData,
156164
'namespace' => $this->getNamespace(),
157165
'gridFilters' => $this->getGridFilterStateValues(),
158-
'columns' => $this->getColumns(),
166+
'columns' => $columns,
159167
'columnPositions' => $this->getColumnPositions(),
160168
'newUrl' => $this->getNewUrl(),
161169
'indexUrl' => $this->getIndexUrl(),

0 commit comments

Comments
 (0)