clearState(part)



The grid's "persist state" property saves user customization of the grid column sequence, column size, and client-side sort to the browser's local storage area. This API can be used to clear/reset all or part of the grid state information in the local storage.

Parameters:

  • part - specifies the portion of the state information to clear (Optional); If not passed, all grid state will be cleared. If passed, the value should be a string that specifies the part of the state to clear. The following strings are valid

    • "colSequence" resets the order of the columns.

    • "colWidths" resets the column widths.

    • "sort" resets the client-side sort.

    • "filters" resets the filters

    • "hidableColState" resets which columns are hidden.

The parameter is not case-sensitive.

Clearing the local storage will not re-render the grid, the changes will be shown the next time the screen is rendered in the browser. The pui.click() or pui.refresh() APIs can be used to trigger a screen render.

Example:

getObj("SFL").grid.clearState(); // Clears everything. getObj("SFL").grid.clearState("colSequence"); // Clears column ordering.