▦K2 Advanced GridsDeveloper Portal / 0.24
Documentation / Column management

Personal preferences

Restore a personalized grid layout on the next visit without additional server storage.

Prerequisites and quick start

Continue from the previous lesson. Use the non-editable 17-column ListView and keep native pagination disabled. The full downloadable configuration includes all preceding features. For a temporary Console experiment use:

Object.assign(K2AdvancedGridsConfig.defaults.preferences, {
    "enabled": true,
    "namespace": "K2AdvancedGrids",
    "allowBrowserScope": true,
    "saveVisibility": true,
    "saveOrder": true,
    "savePinning": true,
    "saveWidths": true,
    "savePageSize": true
});
K2AdvancedGrids.instance.refresh();
Download preferences configuration ↓
Required after saving a configuration file

Replace REPLACE_WITH_YOUR_AREAITEMID with your own ID (see Grid Discovery). Save the configuration, update configVersion in the Data Label loader to a new value (e.g. 0.6.1), save the form and reopen Runtime. Keep engineVersion unchanged. Console-only changes do not require a version change. Rename the downloaded file to purchase-orders.config.js or change the loader path.

Save and restore

Hide Description, Created On and Contact Time. Optionally resize Vendor Name, change pins, reorder columns and select 25 rows per page. Refresh the form and compare each setting. The supplied captures show 14 visible columns before and after restoration, and the diagnostic status restored. They do not independently verify all five settings or a changed page size.

Customized visibility — 14 of 17
Figure 53 · Customized visibility — 14 of 17 · Actual K2 Runtime capture
Restored layout
Figure 54 · Restored layout · Actual K2 Runtime capture

Diagnostic console

console.table(K2AdvancedGrids.instance.inspect().map(g => ({
    areaItemId: g.id,
    preferencesEnabled: g.preferences.enabled,
    preferencesStatus: g.preferences.status
}))); 
Preferences enabled and restored
Figure 55 · Preferences enabled and restored · Actual K2 Runtime capture

Reset grid preferences

Open Manage columns and select Reset grid preferences, not just Reset (visibility only). The saved layout is removed and developer defaults are reapplied. This is useful after changing a configured page size that is overridden by a saved preference.

Reset restores all 17 columns
Figure 56 · Reset restores all 17 columns · Actual K2 Runtime capture

Interactive example

Offline simulation: choose a page size and save, then restore or reset. This demo uses a separate localStorage key and does not modify K2 preferences.

Configuration reference

ParameterValue in lessonBehavior
enabledtrueEnable preferences
namespaceK2AdvancedGridsStorage namespace
allowBrowserScopetrueAllow storage without userKey
userKeyoptionalProvide stable user-specific identifier to separate users
saveVisibilitytrueStore hidden columns
saveOrdertrueStore column order
savePinningtrueStore pins
saveWidthstrueStore resized widths
savePageSizetrueStore page size

Console commands

Replace the placeholder with your own Area Item ID (see Grid Discovery).

const id = 'REPLACE_WITH_YOUR_AREAITEMID';
K2AdvancedGrids.instance.resetPreferences(id);

Benefits and limitations

Local storage is scoped by origin, path, grid and user key (or browser scope). It is not server persistence or cross-device synchronization. Shared browser profiles need a userKey. Storage may be blocked. Saved preferences can override updated defaults; reset when necessary. Filters and sorting are not persisted by these switches.

Enlarged screenshot