Hi we have a listbox with more than 100 values. We have a edit box above that through which the user can filter the values in the listbox.
Suppose the listbox has values - AUDI, JENSEN, HONDA When the user types 'J' in the edit box the listbox shows only JENSEN and hides the rest.
This works fine in chrome and Edge but it is not working in IE - 11 Let us know if anybody has faced this earlier or have a solution for this.
function Custom_SearchSortList_onkeyup(event) {
var eventObject = event ? event : window.event;
var ctrl = eventObject.target ? eventObject.target : eventObject.srcElement;
// TODO: Add your event handler code here
var SortFldFrmList = IbComposer_getComponentById('customselect1_selectfrom').options;
var EventFldFrmList = IbComposer_getComponentById('EventSpecific_list').options;
var SearchString = ctrl.value.toLowerCase().replace(/ /g, " ");
for (i=0;i<SortFldFrmList.length;i++){
var optionValue = SortFldFrmList[i].innerHTML.toLowerCase();
if ( optionValue.indexOf(SearchString) < 0 ){
SortFldFrmList[i].setAttribute("hidden","hidden");
}
else{
SortFldFrmList[i].removeAttribute("hidden");
console.log("present");
}
}
}
The options are updated with hidden="hidden" but the option in the page are still visible in the list box
WF8206This message has been edited. Last edited by: FP Mod Chuck,
October 01, 2019, 02:56 PM
Doug
I would CHAIN the editbox to the listbox using a fex to capture the incoming value from the editbox as a filter and populate the listbox accordingly.
I would not use JavaScript to do this as CHAINing is built into WebFOCUS.
In FOCUS Since 1983 ~ from FOCUS to WebFOCUS. Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
October 01, 2019, 05:06 PM
Waz
Instead of setting visibility, try setting display to none / block or in jquery .hide() .show()
Waz...
Prod:
WebFOCUS 7.6.10/8.1.04
Upgrade:
WebFOCUS 8.2.07
OS:
Linux
Outputs:
HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!
October 01, 2019, 08:00 PM
Doug
I guess I'm not understanding your post.
Are you wanting to hide the values,&Value, that only satisfy a WHERE statement as shown in the next line? Or, are you wanting to hide some 'options'? If 'options', then what options are they?