Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to search from multiselect column of module table? #285

Open
sandeep-ed opened this issue Mar 16, 2018 · 1 comment
Open

How to search from multiselect column of module table? #285

sandeep-ed opened this issue Mar 16, 2018 · 1 comment

Comments

@sandeep-ed
Copy link

I have two modules.
Facility- id, title,
1 - Wifi
2- Parkng
3- Pickup/drop
4-

Hotels- id, name, facilities (multiselect)

Data saved in hotels table as
1, Abc, ["1", "2"]
2, xyz, ["1", "3"]

Problem is that if user search wifi then how to show hotels having facility 1 so on?

@Locolabo
Copy link

The problem is related to MultiSelect combined with a table.
I'm new to laravel so I do not know how to properly override a file, but the problem is located here: "vendor/laravelcollective/html/src/FormBuilder.php"
There is a function called: getSelectedValue if you change the in_array parameter from true (strict compare) to false (loose compare) the problem is solved.

This is related to the fact that in case the MultiSelect is just predefined, it takes the strings and performs a string to string compare.

However if you combine the MultiSelect with a table, it will take the selected items as a string and the option values as integers. So it will compare strings with integers and returns false due to the strict warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants