---
url: "https://vueda.dev/v3/reference/api/js/stores/storeListPreference/functions/storeListPreference.md"
title: "storeListPreference"
---

# storeListPreference

## Overview

Store for persisting ViewList preferences (hidden columns, filters, sorting)
per app/model pair. Keys in `preferences` are built via `getAppModelDotName`,
usually in the form `${app}.${model}`.

## Signature

`storeListPreference(pinia, hot)`

### Parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| <span id="param-pinia">pinia</span> | `Pinia` | no | Pinia instance to retrieve the store |
| <span id="param-hot">hot</span> | `StoreGeneric` | no | dev only hot module replacement |

### Returns

`Store`

## Properties

### $id {#id}

Id of the store. Used by map helpers.

Type: `"listPreference"`

Source: `node_modules/.pnpm/pinia@3.0.4_typescript@5.9.3_vue@3.5.43_typescript@5.9.3_/node_modules/pinia/dist/pinia.d.ts:654`

### getFilters {#getFilters}

Returns a function that gives a copy of the saved filters for one app and model.

Type: `(state: ListPreferenceState) => (args: ListPreferenceArgs) => object`

Source: `client/lib/stores/storeListPreference.js:91`

### getHiddenColumns {#getHiddenColumns}

Returns a function that gives a copy of the hidden column names for one app and model.

Type: `(state: ListPreferenceState) => (args: ListPreferenceArgs) => string[]`

Source: `client/lib/stores/storeListPreference.js:76`

### getPerPage {#getPerPage}

Returns a function that gives the saved rows per page for one app and model.

Type: `(state: ListPreferenceState) => (args: ListPreferenceArgs) => string | number`

Source: `client/lib/stores/storeListPreference.js:117`

### getPreferences {#getPreferences}

Returns a function that gives a copy of all saved preferences for one app and model.

Type: `(state: ListPreferenceState) => (args: ListPreferenceArgs) => ListPreferenceEntry`

Source: `client/lib/stores/storeListPreference.js:64`

### getSorting {#getSorting}

Returns a function that gives a copy of the saved sort fields for one app and model.

Type: `(state: ListPreferenceState) => (args: ListPreferenceArgs) => string[]`

Source: `client/lib/stores/storeListPreference.js:104`

### initialized {#initialized}

Type: `boolean`

Source: `client/lib/stores/storeListPreference.js:48`

### preferences {#preferences}

Type: `object`

Source: `client/lib/stores/storeListPreference.js:54`

## Methods

- [clearFilters](/v3/reference/api/js/stores/storeListPreference/methods/clearFilters.md) - Removes the saved filters for one app and model.
- [clearHiddenColumns](/v3/reference/api/js/stores/storeListPreference/methods/clearHiddenColumns.md) - Removes the saved hidden columns for one app and model.
- [clearPerPage](/v3/reference/api/js/stores/storeListPreference/methods/clearPerPage.md) - Removes the saved rows per page for one app and model.
- [clearPreferences](/v3/reference/api/js/stores/storeListPreference/methods/clearPreferences.md) - Removes every saved preference for one app and model and writes the change to localStorage.
- [clearSorting](/v3/reference/api/js/stores/storeListPreference/methods/clearSorting.md) - Removes the saved sorting for one app and model.
- [init](/v3/reference/api/js/stores/storeListPreference/methods/init.md) - Loads saved preferences from localStorage once.
- [setFilters](/v3/reference/api/js/stores/storeListPreference/methods/setFilters.md) - Saves the filters for one app and model.
- [setHiddenColumns](/v3/reference/api/js/stores/storeListPreference/methods/setHiddenColumns.md) - Saves the hidden column names for one app and model.
- [setPerPage](/v3/reference/api/js/stores/storeListPreference/methods/setPerPage.md) - Saves the rows per page for one app and model.
- [setSorting](/v3/reference/api/js/stores/storeListPreference/methods/setSorting.md) - Saves the sort fields for one app and model.

## Source

`client/lib/stores/storeListPreference.js:41`
