Editor: Ajax filled form fields
Editor: Ajax filled form fields
I would like to enter an address in the Datatables Editor and Google Maps should be queried in the background. The determined coordinates should be saved in a second field.
I used the dependent feature from this Blogpost:
https://datatables.net/blog/2017-09-01
editor.dependent( 'map.street', 'php/get_coordinates.php' );
But this sample fills an select Inputfield with options.
I don't know the json syntax to put the determined coordinates in an textfield in datatables editor.
Hope someone can help me.
Thanks,
Tobias
Answers
Hi Tobias,
The
dependent()
method's documentation can be difficult to read, because it has so many options! But basically you'll want to return an object to the callback something like this:Another, and possibly easier option is just to call the Editor value methods once you've got the values you want:
Doing a blog post on Editor integration with Google map address lookup is something that I've been meaning to do for a while - thanks for the reminder.
Allan