structured-filter
structured-filter copied to clipboard
Dropdown select filter
It would be nice to give a predefined list of values for a filter. For example, if the data that was being queried only had X options for a field, would be nice to show all of them and let the user select the one they wanted. Would use less screen space than a normal list of say 10 options, though would be limited to only one option?
Perhaps:
{ type: "selectList", id: "myID", label: "Birthmonth", list: [
{id: "jan", label: "January"},
{id: "feb", label: "February"},
{id: "mar", label: "March"},
{id: "apr", label: "April"},
{id: "may", label: "May"},
{id: "jun", label: "June"},
{id: "jul", label: "July"},
{id: "aug", label: "August"},
{id: "sep", label: "September"},
{id: "oct", label: "October"},
{id: "nov", label: "November"},
{id: "dec", label: "December"}
]}
and then:
case fTypes.selectList:
var arrayLength = this._field.list.length;
h+='<select id="value">'+EvoUI.optNull;
for (var i = 0; i < arrayLength; i++) {
h+=EvoUI.inputOption(this._field.list[i].id, this._field.list[i].label);
}
h+='</select>';
break;
just a rough sketch of a possible way?