Angular JavaScript AutoComplete Cant Find Address Field (Add Custom Fields to AutoComplete) - javascript

I am making a little component for an app I am working on using the Google Places API and am looking to be pointed in the right direction in terms of manipulating the DOM to add a custom field above the 5 options on the Google Places AutoComplete API.
I do not think making a directive is an option here because I only have the input field for the feature. I am open to other tricks.
I am using https://www.npmjs.com/package/ngx-google-places-autocomplete for the Places API and I got everything working, but for some reason, I cannot in the life of me build the solution for adding a custom field prepended above the 5 address options on the prefill.
Anyone else dealing with this?

Related

GA Custom Dimensions in Wordpress - implement datalayers correctly

I need some guidance on a problem I can't solve with google so far.
Situation:
I have a wordpress site with the custom post type Jobs. With the plugin Advanced Custom Fields I created custom fields i want to track (location, type of contract, company).
In google Analytics I created 5 custom Dimensions:
postCategories (can be Blog or Job category and can have more than 1)
postTags (same as 1)
jobContract
jobLocation
jobCompany
My Question: how do I pull the variables from WordPress? I know that i can do this with GTM and Datalayers, but i don't know what code i have to implement into my wordpress site to push these variables into Datalayers so that GA can track it as Custom Dimensions. I also struggle with the multiple category thing. If i define data layers, how can i track multiple Categories for 1 pageview?
I hope my description is clear, if not feel free to ask :)
Assuming you have set up your pageview tag in GTM, you can add the variables from the JavaScript macros within the “custom dimension” field under the tag set up.
Go to variables and create a custom variable and to retrieve these tags. Depending on how they are displayed would change how you can retrieve them.
Can you post a screen shot of what the page looks like or a URL to view?

Multi-field type ahead search box in html and javascript

I am trying to create a search box for searching structured data, where all the fields are known. I want to create a type ahead search box which has two types of typeaheads: 1. Type ahead for fields 2. Type ahead for values of a specific field. Image below shows what I am trying to achieve.
I already have the backends ready to serve typeaheads and searches. I am not able to figure out how to create a custom text field that can submit multiple form values and query multiple typeahead backends
This is a lot like gmail or kibana search boxes. Will appreciate examples or if someone can point me in the correct direction.
PS: A complete javascript newbie here. I can only understand pure js or jquery.
I suggest using a jquery library would be easy option to this. Looking at your question, i think select2 or bootstrap multiselect could probably help you.

Fully custom lightbox in dhtmlxGantt

Hi there,
I'm looking at using dhtmlxgantt as a way of building up an itinerary i.e. you add items at specific days throughout a period (most likely 2 weeks)... However, there are quite a few extra variables that I need to store along with the standard info of dates etc. There are a series of 4 dropdowns which populate the next one via AJAX.
I know I can add custom controls into the lightbox but these will not work via AJAX when the previous dropdown is changed. I was hoping that I'd be able to make a fully custom lightbox which then passes everything back to dhtmlxGantt but I can't seem to find away...
It looks like it's possible in the scheduler product (http://docs.dhtmlx.com/scheduler/samples/02_customization/16_custom_form.html) can we do the same with Gantt?
Thanks in advance,
Adam.
You can just redefine gantt.showLightbox method and show your form from there. And then use public API to save changes - gantt.addTask, gantt.updateTask, gantt.deleteTask
Here is a crude example:
http://docs.dhtmlx.com/gantt/snippet/5e134aa1

Address Auto complete using Google Maps API

I am currently using google maps api to suggest addresses as user types into an input field. When they select one of the drop down suggestions provided by google, the state/province gets automatically updated.
I was wondering if there was a way to update the state/province without selecting the suggestions google provides? Maybe a user neglects to select a provided option, how do you then automatically update the state/province
example - https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform
Since the data is stored in google's database,I don't think you can update automatically if you don't click on an element of the list, because if you don't click, the google object is not created.
You can still try to convert the value of your input text into a google object but i don't think it's possible (if it is not a google.maps.places.Autocomplete object you can't use getPlace() ).
I tried it already because i was facing the same problem and din't find a solution either, maybe you will manage to convert the input into a google.maps.places.Autocomplete object. It's the only way if you want to use the data of google.

Autocomplete for textfield in Sencha Touch?

I'm making an flight search app with Sencha Touch and have encountered a small problem.
I want to create a textfield for all the airports and need autocomplete functionality for in order to make it easy for the user to choose departure airport and return airport. How can i implement this? The airports will be loaded via XML-schema and I can't seem to find any good documentation for this feature.
Thanx in advance!
Since there were no custom components out there and I needed something like this myself as well, I smashed it together.
So, here it is. Sencha Touch 2 Autocomplete Textfield component:
https://github.com/martintajur/sencha-touch-2-autocomplete-textfield
It currently uses AJAX request response for populating the autocomplete matches. It also supports custom input by the user.
When serializing the form data, the value of this type of input will be:
the selected item ID in case user has selected a matched autocomplete result
the typed text when the user has not chosen an autocomplete result
It is very basic at the moment and completely driven by own need for such a control.
Feel free to fork, modify, adapt. It's MIT-licenced.
I think you should use a searchfield instead of textfield as suggested by #Ismailp,
Then you should create a popup(a panel) in its keyup event, which should contain a list of Airports.
Go through the hidden folder list-search in the example folder in downloaded sencha framework.It shows how to search through a list.

Categories

Resources