Skip to content

Commit e17acf3

Browse files
Merge pull request #10 from tiller1010/init-default-state
Init default state if method exists
2 parents 3ac010a + 0f816ff commit e17acf3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/PersistentGridField.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,12 @@ public function gridFieldAlterAction($data, $form, HTTPRequest $request)
161161
$actionName = $stateChange['actionName'];
162162
if ($actionName === 'ResetState') {
163163
$session->set($stateHash, null);
164-
$this->state = new GridState($this);
164+
if (method_exists($this, 'initState')) {
165+
$this->state = null;
166+
$this->getState(false);
167+
} else {
168+
$this->state = new GridState($this);
169+
}
165170
}
166171
}
167172
}

0 commit comments

Comments
 (0)