Ensure that when a user chooses the sort-by-title option in the invoice
lineitem search UI, then de-selects the option, the sort returns to the
default lineitem ID sort.
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
if (dojo.byId('acq-invoice-search-sort-title').checked) {
uriManager.order_by =
[ {"class": "acqlia", "field":"attr_value", "transform":"first"} ];
- }
+
+ } else {
+
+ // last used order_by is cached in the global resultManager config
+ // in this case, we want to fall back to the default order_by (li.id)
+ delete resultManager.result_types.lineitem.search_options.order_by;
+ delete uriManager.order_by;
+ }
resultsLoader.lastSearch = searchObject;
resultManager.go(searchObject)