Multi Column autoComplete Search with Editor 1.3.2?

Multi Column autoComplete Search with Editor 1.3.2?

mxsquidmxsquid Posts: 16Questions: 3Answers: 0
edited August 2014 in Editor

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

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    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

  • mxsquidmxsquid Posts: 16Questions: 3Answers: 0

    Hi Allan,

    Once again, thank you for your prompt feedback! Let's see if I can simplify my question for general use.

    1. I want to populate a "Business" MySQL DataTable with 4 fields that I don't want users to edit manually. I call these fields Cid, Category, Sid, Specialty
    2. The source of "Category-Specialty" information is on a MySQL table related to "Business"
    3. Using stand-alone jQueryUI Autocomplete, I'm able to return the "official" Cid, Sid plus human readable Category and Specialty information http://finditgroup.org/autocomplete/index.html.
    4. I would like to be able to call my external code as a function within Editor returning an array with which to populate the 4 "Business" fields at once.
    5. I like your idea of creating an editor button for this purpose as in this example https://editor.datatables.net/examples/plug-ins/fieldPlugin.html
    6. Are there any other considerations before I dive into this?

    Now about that Integration Specialist job for $372,000 :-)

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin

    I want to populate a "Business" MySQL DataTable with 4 fields

    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 .) :-).

    Now about that Integration Specialist job for $372,000 :-)

    Haha - Brielle Williamson does alright for herself...

    Allan

  • mxsquidmxsquid Posts: 16Questions: 3Answers: 0

    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!

  • allanallan Posts: 63,523Questions: 1Answers: 10,473 Site admin
    Answer ✓

    I'm going for updating 4 columns at once with a simple button plugin solution.

    If you are using the Editor PHP libraries you'll need to provide 4 Field instances in that case, and use a setFormatter() 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).

    Coding is like brain surgery. It's simple when you know what you're doing. Hah!

    I'll stick to coding I think. Slightly easier to fix any bugs that occur...

    An interesting challenge, indeed!

    Let us know how you get on with it.

    Allan

  • mxsquidmxsquid Posts: 16Questions: 3Answers: 0

    Slightly easier to fix any bugs that occur...

    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.

This discussion has been closed.