AnsweredAssumed Answered

Manipulate fields value in record view

Question asked by Caim Astraea on Sep 28, 2015
Hello ,
Having some problems integrating google autocomplete with the sugar fields in the record view for Accounts(clients) for example.

I added some fields to the view which can be used for the autocomplete however can't seem to figure out how to bind 
new google.maps.places.Autocomplete(input,{types: ["geocode", "establishment"]});
to any of the default fields already on the record page, like <name> for the account name etc.

Also to note none of these fields exist prior to clicking on any of them which opens the quickedit,  so maybe that's part of the issue. 

Furthermore how would one go about manipulating the fields after autocomplete , for example billing_address_street, billing_address_city etc are not available to dom manipulation so a document.getElementsByName or id ? (billing_adress_city).value = "value";
 would be out of the question. The only method left would be to set the model using  this.model.set('billing_address_street',place.address_components[i][componentForm[addressType])

I'm thinking of adding an event on the field i want to autocomplete using google api ,['change input[name=name]']  = 'fillInAddress';  or initialize for the maps ... just can't tie it all up 

Here's a gist of what I tried so far :

the view I made in /custom/clients/views/geocomplete/mine.hbs that contains the test field inputs. 

Any ideas or suggestions would be much appreciated , thank you.