739867367229d55193ca5bf94f1c271478187383 braney Thu Sep 6 11:17:42 2018 -0700 only do "all or one or more" on bigBed filterBy's and fix bug #20227 diff --git src/hg/lib/hui.c src/hg/lib/hui.c index 740ff8d..e7c7e5d 100644 --- src/hg/lib/hui.c +++ src/hg/lib/hui.c @@ -3968,64 +3968,65 @@ char *setting = cartOrTdbString(cart, tdb, settingString, FILTERBY_MULTIPLE_LIST_AND); boolean isMultiple = sameString(setting, FILTERBY_MULTIPLE) ||sameString(setting, FILTERBY_MULTIPLE_LIST_OR) ||sameString(setting, FILTERBY_MULTIPLE_LIST_AND); puts("<TD>"); char selectStatement[4096]; if (isMultiple) safef(selectStatement, sizeof selectStatement, " (select multiple items - %s)", FILTERBY_HELP_LINK); else selectStatement[0] = 0; if(count == 1) printf("<B>%s by %s</B>%s",filterTypeTitle,filterBy->title,selectStatement); else printf("<B>%s</B>",filterBy->title); printf("<BR>\n"); - if (isMultiple) + if (isMultiple && tdbIsBigBed(tdb)) { char cartSettingString[4096]; safef(cartSettingString, sizeof cartSettingString, "%s.%s", tdb->track, settingString); printf("<b>Match if "); cgiMakeRadioButton(cartSettingString, FILTERBY_MULTIPLE_LIST_AND, sameString(setting, FILTERBY_MULTIPLE_LIST_AND)); printf(" all "); cgiMakeRadioButton(cartSettingString, FILTERBY_MULTIPLE_LIST_OR, sameString(setting, FILTERBY_MULTIPLE_LIST_OR)); printf(" one or more match</b> "); } // TODO: columnCount (Number of filterBoxes per row) should be configurable through tdb setting // value is always "All", even if label is different, to simplify javascript code + int valIx = 0; if (isMultiple) { printf( "<SELECT id='%s%d' name='%s' multiple style='display: none; font-size:.9em;' class='filterBy'><BR>\n", selectIdPrefix,ix,filterBy->htmlName); printf("<OPTION%s value=\"All\">%s</OPTION>\n", (filterByAllChosen(filterBy)?" SELECTED":""), allLabel); - ix = 1; + valIx = 1; } else { printf( "<SELECT id='%s%d' name='%s' style='font-size:.9em;'<BR>\n", selectIdPrefix,ix,filterBy->htmlName); - ix = 0; + valIx = 0; } struct slName *slValue; - for (slValue=filterBy->slValues;slValue!=NULL;slValue=slValue->next,ix++) + for (slValue=filterBy->slValues;slValue!=NULL;slValue=slValue->next,valIx++) { char varName[32]; char *label = NULL; char *name = NULL; if (filterBy->useIndex) { - safef(varName, sizeof(varName), "%d",ix); + safef(varName, sizeof(varName), "%d",valIx); name = varName; label = slValue->name; } else { label = (filterBy->valueAndLabel ? slValue->name + strlen(slValue->name)+1 : slValue->name); name = slValue->name; } printf("<OPTION"); if (filterBy->slChoices != NULL && slNameInList(filterBy->slChoices,name)) printf(" SELECTED"); if (filterBy->useIndex || filterBy->valueAndLabel) printf(" value='%s'",name); if (filterBy->styleFollows)