Multi Column autoComplete Search with Editor 1.3.2?
Multi Column autoComplete Search with Editor 1.3.2?
Hi all,
I'm looking for a simple way to categorize businesses.
Towards this end, I've developed jQueryUI autocomplete functionality to search multiple columns to pick up 4 data items in a MySQL table. My drop-down "select" list returns Category ID, Category, Specialty ID, Specialty. The search data can be found in either the Category or Specialty column
An orthodontist for example, would have the following categorization:
Category: 20 HEALTH | MEDICAL Specialty: 204 Dentists | Orthodontists | Braces
Try typing ortho http://finditgroup.org/autocomplete/index.html
So finally, when I edit a business datatable, I would like the internal data structure to update multiple fields as above. Is this possible with Editor 1.3.2 and the existing autoComplete plugin?
This question has an accepted answers - jump to answer
Answers
If I understand correctly, is the value of the field the list shown in the Result box of your example? If so, then a custom plug-in would need to be created for Editor that provides this ability (and presumably also add the option to remove selected items) since the existing autoComplete plug-in uses the auto complete's own input as the value, rather than anything else (the Result box for example).
The Editor manual has details on how to create a field type plug-in: https://editor.datatables.net/manual/development/field-types .
Regards,
Allan
Hi Allan,
Once again, thank you for your prompt feedback! Let's see if I can simplify my question for general use.
Now about that Integration Specialist job for $372,000 :-)
1 SQL column, or 4?
Either way, it does sound very much like a custom field type is going to be the way forward here. That will provide complete flexibility over the input and values, and plug-ins are fairly [simple to create](https://editor.datatables.net/manual/development/field-types .) :-).
Haha - Brielle Williamson does alright for herself...
Allan
Hi Allan,
OK, then, I'm going for updating 4 columns at once with a simple button plugin solution. I was concerned about considerations for "state saving" when leaving the Editor application to go to a url containing external functions in php, html, javascript.
Coding is like brain surgery. It's simple when you know what you're doing. Hah!
Custom Function On a Field Name
https://editor.datatables.net/reference/option/fields.data
Custom Function On Validation
https://editor.datatables.net/manual/php/validation
and of course you pointed out,
Custom Field Types for Plug-in Development
https://editor.datatables.net/manual/development/field-types
An interesting challenge, indeed!
If you are using the Editor PHP libraries you'll need to provide 4
Field
instances in that case, and use asetFormatter()
to decode the single value into the component part for he field in question (depending on how the value of the field on the client-side is handled - it is actually possible to have the value as an object which might be useful for you).I'll stick to coding I think. Slightly easier to fix any bugs that occur...
Let us know how you get on with it.
Allan
Piece-a-cake, right? I'll give myself a week. I'd love to learn and then show off custom plug-in development to the DataTables development community. I was thrilled I could do multi-category autocomplete using jQueryUI with a PHP, MySql back-end.