▦K2 Advanced GridsDeveloper Portal / 0.23
Documentation / Column management

Column pinning

Keep identifiers and status visible while scrolling across wide tables.

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.columnPinning, {
    "enabled": true,
    "allowUserPinning": true,
    "pinnedStart": [
        "Order Number",
        "Vendor Name"
    ],
    "pinnedEnd": [
        "Status"
    ],
    "maxPinnedColumns": 3
});
K2AdvancedGrids.instance.refresh();
Download pinning 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.

Pin to start and end

Order Number and Vendor Name are pinned to start; Status to end. Scroll horizontally and compare the two positions.

Pinned columns at initial position
Figure 45 · Pinned columns at initial position · Actual K2 Runtime capture
Pinned columns during horizontal scrolling
Figure 46 · Pinned columns during horizontal scrolling · Actual K2 Runtime capture

Change pinning in Runtime

Right-click Vendor Name and choose Unpin column. Pin to start/end and Unpin all are also available.

Pinning commands
Figure 47 · Pinning commands · Actual K2 Runtime capture
Vendor Name unpinned; Order Number and Status remain pinned
Figure 48 · Vendor Name unpinned; Order Number and Status remain pinned · Actual K2 Runtime capture

Interactive example

Offline simulation: scroll the table and toggle sticky columns.

Order NumberVendorDepartmentDescriptionOrder AmountStatus
PO-2026-00001Apex ServicesProcurementPurchase order for business supplies8,169.00Pending Approval
PO-2026-00002Cedar ConsultingITPurchase order for business supplies16,088.00Cancelled
PO-2026-00003Blue HorizonOperationsPurchase order for business supplies24,007.00Approved

Configuration reference

ParameterValue in lessonBehavior
enabledtrueEnable pinning
allowUserPinningtrueAllow runtime pin/unpin
pinnedStartOrder Number, Vendor NameInitial leading pins
pinnedEndStatusInitial trailing pins
maxPinnedColumns3Limit on adding runtime pins; keep configured pins within this limit

Console commands

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

const id = 'REPLACE_WITH_YOUR_AREAITEMID';
K2AdvancedGrids.instance.setColumnPinned(id, 'Vendor Name', null);
K2AdvancedGrids.instance.setColumnPinned(id, 'Vendor Name', 'start');
// Reset to configured pins
K2AdvancedGrids.instance.resetPins(id);

Benefits and limitations

Requires horizontal scrolling. Leave enough unpinned viewport space. Start/end follow interface direction; the screenshots demonstrate LTR.

Enlarged screenshot