Select dropdown with LIKE behaviour
See original GitHub issueHello.
In my table, the first column is a combination of data that I pass a string with @ as separator and the format them with the formatter function as follow:
This is my column definition:
let projectFilter;
columns = [{
dataField: 'project',
text: 'Project',
filter: textFilter({
options: fpsoOptions,
getFilter(filter){
projectFilter = filter;
},
style: { display: 'none' }
}),
sort: true,
formatter: this.projectFormatter,
headerStyle: (col, idx) => {
return smHeaderStyle;
},
}, [..]
And this is the projectFormatter function:
projectFormatter = (cell, row) => {
const values = cell.split('|');
const fpsos = values[0].split('@');
return (
<div>
{fpsos.map((pu, idx) => {
const identity = pu.split(';')[0];
const id = pu.split(';')[1];
const separator = idx !== fpsos.length - 1 ? ", " : '';
return (
<Link to={`/view/${id}/fpso`}>{identity}{separator}</Link>
)
})}
<br/>
<span><b>{ values[1] }</b></span><br/>
</div>
);
}
The filtering works fine when it is a text input filter. Now, I’m trying to do a custom select filter with a LIKE operator behaviour, which the selected value in the dropdown (fpso list) would be filtered as a substring of this column.
This is my onChange function that triggers the table filter, as shown in the documentation here. But I’m not sure how to get the like behaviour.
const onChangeFilter = (e) => {
projectFilter(e.target.value)
}
I appreciate any clue/help. Thanks in advance
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Dropdown - Semantic UI
A dropdown allows a user to select a value from a series of options.
Read more >Divs dropdown to behave like select or combo - Stack Overflow
I need different functionality, when click to Option element to change the value in the Select div and nothing more, same behaviour like...
Read more >UI cheat sheet: dropdown field - UX Collective
While not technically a dropdown, a multiple select menu is an alternative to consider. Unlike a dropdown, they are open from the start...
Read more >behavior:dropdown-select - Sciter
size=integer - number of visible elements in the dropdown list. Note: height of the select element can be overriden by CSS. name="name" -...
Read more >Dropdown - Multiselect - Carbon Design System
Dropdowns present a list of options from which a user can select one option, or several. A selected option can represent a value...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

BTW, if you are implement the custom filter, the default comparator will be
LIKE, here is a custom filter example.@nigellima so far the select filter use
EQas default comparator and it can not be change/configure. I will enhance this when I have time, thanks