Editor Dropdown Filtering
Editor Dropdown Filtering
I've got Editor server-side set up to handle drop-downs.
https://editor.datatables.net/docs/1.6.1/php/class-DataTables.Editor.Options.html
Unfortunately, when I use dt.column(x).search(str), it searches the VALUE, not the result of RENDER.
So if I have a dropdown containing <option value="1">Foo</option>, I have to search for "1", instead of "Foo". There should be a way to search for "Foo", correct?
The user will always see "Foo" and never see "1", so they will never know to search for "1".
This question has an accepted answers - jump to answer
Answers
I'm not sure what is going wrong here I'm afraid. If we take this example as a base, you can search for the label (since that is shown in the Location column).
How does your code differ from that example? Can you link to your page so I can see it please?
Allan
Turns out that example had exactly what I needed!
I had the client-side columns[].data option and the editor.fields[].name option set to the same thing. I needed to add a JOIN on the server-side, add the joined field to the editor instance server-side and put the joined table's field in the columns[].data option on the client-side.
All good now, thanks a ton!