angular: add filtering, sticky headers, and other improvements to eg-grid
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Evergreen |
Fix Released
|
Wishlist
|
Unassigned |
Bug Description
This bug is for the following improvements to eg-grid:
This patch enables users to filter results in Angular eg-grids that
use PCRUD-based data sources.
Filtering can be enabled in an eg-grid defintion by adding the following
attribute to <eg-grid>:
[
If, for some reason, a particular column should not be filterable by the
user, filtering can be disabled by passing false to the [filterable]
attribute of an <eg-grid-column> element like this:
<
When filtering is enabled, a new section of the grid header is displayed that
includes, for each filterable column:
* A drop-down menu letting the user specify an operator such as
"is exactly", "exists" (i.e., is not null), "is greater than", and so
forth. The drop-down also allows the user to clear a filter for a
specific column or re-apply it after changing the operator.
* An input widget for setting the value to filter on. The type of input
displayed depend on the IDL type of the column. For example, a text field
will use a normal text <input>; an OU field will use an eg-org-select,
a link to another IDL class will use a combobox, a timestamp field
will use an eg-date-select, and so forth.
* A separate display of the current operator.
When filtering is enabled, the grid will also display a "Remove Filters" button
in the action bar.
Under the hood, the widgets for entering filtering parameters expect
the data source to have a "filters" key that in turn contains a
dictionary of PCRUD-style filtering conditions indexed by column name.
Consequently, a grid data source that wants to use filtering should
look something like this:
const orderBy: any = {acp: 'id'};
if (sort.length) {
}
// base query to grab everything
let base: Object = {};
var query: any = new Array();
// and add any filters
});
});
return this.pcrud.
});
};
This patch also adds two related grid options, sticky headers and the ability
to reload the data source without losing one's current place in page.
Sticky headers are enabled by adding the following attribute to the
<eg-grid> element:
[
When this is enabled, as the user scrolls the grid from top to bottom, the
header row, including the filter controls, will continue to remain visible
at the top of the viewport until the user scrolls past the end of the
grid entirely.
Reloading grids without losing the current paging settings can now be
done by a caller (such as code that opens an edit modal) invoking a new
reloadSansP
This is part of a project to prepare for converting some acquisitions interfaces to Angular. Work on this bug was sponsored by MassLNC, Georgia Public Library Service, Indiana State Library, CW MARS, and King County Library System.
Changed in evergreen: | |
milestone: | none → 3.4-beta1 |
importance: | Undecided → Wishlist |
Changed in evergreen: | |
assignee: | nobody → Bill Erickson (berick) |
status: | New → Confirmed |
Changed in evergreen: | |
assignee: | nobody → Bill Erickson (berick) |
Changed in evergreen: | |
assignee: | Bill Erickson (berick) → Galen Charlton (gmc) |
Changed in evergreen: | |
assignee: | nobody → Galen Charlton (gmc) |
Changed in evergreen: | |
status: | Fix Committed → Fix Released |
Patch(es) for this are available as part of the following branch:
working/ collab/ gmcharlt/ angular- widget- improvements- 2019-06 /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/collab/ gmcharlt/ angular- widget- improvements- 2019-06
https:/
Patches for the improvements here depends on the patches for the following bugs in that same branch:
bug 1831780
bug 1831783
bug 1831785
Bugs in that branch that the grid improvements do _not_ depend on are:
bug 1831781
bug 1831784
bug 1831786
However, if at all possible, speedy review of the entire branch would be handy.