From c9db507457a37ccf689399cdd5170b1b6799a2ef Mon Sep 17 00:00:00 2001 From: skrustev Date: Tue, 22 Oct 2024 21:23:29 +0300 Subject: [PATCH] Add note regarding persisting requirement for row selection. --- en/components/grids_templates/state-persistence.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/en/components/grids_templates/state-persistence.md b/en/components/grids_templates/state-persistence.md index 9760a890b8..a8bad5a3ce 100644 --- a/en/components/grids_templates/state-persistence.md +++ b/en/components/grids_templates/state-persistence.md @@ -94,6 +94,9 @@ _canonicalLink: grid/state-persistence > The [`IgxGridState`]({environment:angularApiUrl}/classes/igxgridstatedirective.html) directive does not take care of templates. Go to [Restoring Column](state-persistence.md#restoring-columns) section to see how to restore column templates. } +>[!NOTE] +> The `Row Selection` feature requires the [`primaryKey`]({environment:angularApiUrl}/classes/IgxGridComponent.html#primaryKey) property to be set, so it can be stored/restored correctly. + ## Usage [`getState`]({environment:angularApiUrl}/classes/igxgridstatedirective.html#getState) - This method returns the grid state in a serialized JSON string, so developers can just take it and save it on any data storage (database, cloud, browser localStorage, etc). The method accepts first optional parameter `serialize`, which determines whether [`getState`]({environment:angularApiUrl}/classes/igxgridstatedirective.html#getState) will return an [`IGridState`]({environment:angularApiUrl}/interfaces/igridstate.html) object or a serialized JSON string.