Skip to content

Store bootgrid settings in local browser storage #5439

@8191

Description

@8191

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Is your feature request related to a problem? Please describe.

Many MVC pages make use of jQuery Bootgrid (by using the OPNsense specific UIBootgrid wrapper). Bootgrid allows the user to configure many things:

  • Search filters
  • Elements displayed per page
  • Column visibility
  • Selected page

Unfortunately these settings are lost as soon as the user leaves the page.

It would be a great feature to persist those settings on a per-user basis. When a user opens a settings page they've already modified before (e.g. changed visible columns, number of rows per page, etc.) the previous settings are restored. Settings could be stored in the local browser storage.

Describe the solution you like
The PR rstaib/jquery-bootgrid#392 could be incorporated into OPNsense's jQuery Bootstrap.

Note: this is a manual task as OPNsense's jQuery Bootgrid already diverged from its upstream.
Question: where is "the master-copy" of jQuery boostrap? In the opnsense/core or in opnsense/jquery-bootstrap repository?

Describe alternatives you considered
Implementation of a "workaround" into the UIBootgrid function

$.fn.UIBootgrid = function (params) {

to simulate restoring the settings, e.g. using

var rowCount = localStorage.getItem(grid_id+"_rowCount");
$(this_grid).find('.bootgrid-pagination-count ul.dropdown-menu li a[data-action=' + rowCount + ']').trigger('click');

Not really nice and most likely time consuming for things like selecting columns.

To clarify/discuss

  • Which settings to persist
  • Design (implement in opnsense_bootgrid_plugin (UIBootgrid) or in jquery-bootgrid)
  • How to uniquely identify a bootgrid (is the HTML ID sufficient or do we need to consider the browser URL as well?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions