• Resolved kentauron

    (@kentauron)


    Hi,

    is there a way to define an autocomplete field or a dropdown list with data taken from another table?

    Thank you

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author bobbysmith007

    (@bobbysmith007)

    There is an open issue for this on Git Hub, but I have not really looked into custom slick grid editors at all.

    It is definitely possible, but usually I have opted for a custom interface when it gets to that point. If you make any progress, please do update the ticket:

    https://github.com/AccelerationNet/wp-db-table-editor/issues/11

    Thread Starter kentauron

    (@kentauron)

    There are same working examples, like this one:
    https://github.com/6pac/SlickGrid/blob/master/examples/example-select2-editor.html

    But my issue is how to pass ‘formatter’, ‘editor’ and ‘datasource’, to send something like this:
    {id: “CountryOfOrigin”, name: “Country Of Origin”, field: “country”, minWidth: 200, formatter: Select2Formatter, editor: Select2Editor, dataSource: countryIsoAndNameList }

    I think that plugin code needs to be modified to do that(?)

    Thread Starter kentauron

    (@kentauron)

    I successfully did it, but modifying a lot the code of the plugin, by adding part of the code taken by the above mentioned example and adding a new arg to define which fields will use “select formatter” and the queries to get data that will populate those lists, something like this:
    ‘selects’ => ‘fieldx:SELECT id, fieldname FROM wda_table1 ORDER BY fieldname ASC;fieldy:SELECT id, fieldname2 FROM wda_table2 ORDER BY fieldname2 ASC’

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Autocomplete and dropdown list with data from other table’ is closed to new replies.