e14e13c90aa4b8a325f165d44bca1035cd111bb8 galt Sat Feb 1 12:40:53 2020 -0800 cirm cdwWebBrowse. Cannot just pass initialwhere, so get it from the cart. diff --git src/hg/lib/tablesTables.c src/hg/lib/tablesTables.c index 89cb7cd..dab9121 100644 --- src/hg/lib/tablesTables.c +++ src/hg/lib/tablesTables.c @@ -72,31 +72,30 @@ /* Print instructional text, and basic summary info on who passes filter, and a submit * button just in case user needs it */ { /* Print info on matching */ int matchCount = slCount(table->rowList); if (largerContext != NULL) // Need to page? matchCount = largerContext->tableSize; printf(""); printf("  "); printf(""); jsOnEventById("click", "clearButton", "$(':input').not(':button, :submit, :reset, :hidden, :checkbox, :radio').val('');\n" "$('[name=cdwBrowseFiles_page]').val('1');\n" - "$('[name=clearSearch]').val('1');\n" "$('#submit').click();\n"); printf("
"); printf("%d %s found. ", matchCount, itemPlural); if (addFunc) addFunc(matchCount); if (!visibleFacetList) { printf("
\n"); printf("You can further filter search results field by field below. "); printf("Wildcard * and ? characters are allowed in text fields. "); printf(">min or <max are allowed in numerical fields.
\n"); @@ -382,80 +381,80 @@ "$('[name=%s_page]').val('%d');\n" "$('#submit').click();\n" , varPrefix, totalPages); } } } } void webFilteredFieldedTable(struct cart *cart, struct fieldedTable *table, char *returnUrl, char *varPrefix, int maxLenField, struct hash *tagOutputWrappers, void *wrapperContext, boolean withFilters, char *itemPlural, int pageSize, struct fieldedTableSegment *largerContext, struct hash *suggestHash, struct facetField **ffArray, char *visibleFacetList, - void (*addFunc)(int), char *initialWhere) + void (*addFunc)(int)) /* Show a fielded table that can be sorted by clicking on column labels and optionally * that includes a row of filter controls above the labels . * The maxLenField is maximum character length of field before truncation with ... * Pass in 0 for no max */ { if (strchr(returnUrl, '?') == NULL) errAbort("Expecting returnUrl to include ? in showFieldedTable\nIt's %s", returnUrl); if (withFilters || visibleFacetList) showTableFilterInstructionsEtc(table, itemPlural, largerContext, addFunc, visibleFacetList); // Show top bar with quick-deselects for selected facet values // as well a clear restriction button that cleans out cdwFile_filter cart var. if (visibleFacetList) { + char *where = cartUsualString(cart, "cdwFile_filter", ""); - if (!isEmpty(initialWhere)) + if (!isEmpty(where)) { // left column printf("
\n"); - printf("Restricting files to where %s. ", initialWhere); + printf("Restricting files to where %s. ", where); printf("  "); printf(""); jsOnEventById("click", "clearRestrictionButton", - "$(':input').not(':button, :submit, :reset, :hidden, :checkbox, :radio').val('');\n" "$('[name=cdwBrowseFiles_page]').val('1');\n" "$('[name=clearRestriction]').val('1');\n" "$('#submit').click();\n"); printf("
"); } boolean gotSelected = FALSE; struct slName *nameList = slNameListFromComma(visibleFacetList); int f; for (f = 0; f < table->fieldCount; ++f) { struct facetField *field = ffArray[f]; if (slNameInListUseCase(nameList, field->fieldName)) // i.e. is this field a visible facet? { if (!field->allSelected) { if (!gotSelected) { - if (isEmpty(initialWhere)) // we still need to do this + if (isEmpty(where)) // we still need to do this { // left column printf("
\n"); } htmlPrintf("
\n"); gotSelected = TRUE; } htmlPrintf("\n"); htmlPrintf("
\n"); htmlPrintf("
%s
\n", field->fieldName); struct facetVal *val; // Sort values alphabetically // Make a copy to not disturb the original order @@ -485,31 +484,31 @@ printf("\n"); } } slFreeList(&valListCopy); htmlPrintf("
\n"); } } } if (gotSelected) htmlPrintf("
\n"); - if (!isEmpty(initialWhere) || gotSelected) + if (!isEmpty(where) || gotSelected) printf("

\n"); } printf("
\n"); // parent container if (visibleFacetList) { // left column printf("
\n"); // reset all facet value selections char *op = "resetAll"; htmlPrintf("