Implementing Google Maps Autocomplete in SlickGrid - google-maps

Has anyone successfully accomplished this? I would like to initialize the autocomplete in a SlickGrid cell. I suspect that fashioning an autocomplete editor may be the way to go.
The cells don't have a DOM id but I have been able to use a getElementsByClassName('slick-cell l5 r5 cell-title active selected'), which is the cell that my Address column is in. I have seen where others have implemented an Autocomplete editor supplying a list but I can't seem to get either of these methods to work with the Google Maps Autocomplete code.
I'm fairly new to SlickGrid but have managed to accomplish many other things successfully except this one. Anyone pulled this off?

Related

AppScript. Is there a way to check if list item has a checkbox?

Google document allows to add list items with a checkboxes, like on the screenshot below:
I need to write a appscript to check if list item has a checbox, but i haven't found appropriate field/method in documentation and this kind of list item return null instead of GlyphType:
Does anyone know if it is actually possible somehow?
This isn't currently possible!
But there is already a report on Google's Issue Tracker which requests the behaviour you seek:
Add support for all glyph types in Docs (bullets and number formats)
Google does seem to know about this feature request but if it's causing problems I suggest leaving a comment to bump its priority.
You can also hit the ☆ next to the issue number in the top left on the aforementioned pages which lets Google know more people would like to see this implemented.

Moving an item from one Google form to a new Google form using google apps script

When editing a Google form manually, you can usually click on an item, and on the side appears a menu, which includes the button "import questions". This button is very useful for me as it allows me to collect questions from past Google forms and import them to new Google forms.
But I'm looking through the Forms documentation, and I can't figure out how to do this via Google apps script programatically.
Here is the documentation:
https://developers.google.com/apps-script/reference/forms/form
The closest thing to what I want is the .moveItem() method, which moves an item from one spot in a form to another. But it only works within the same form. I want to know if I could do it across forms. And ideally, instead of moving the item, it would make a copy of the item in the new form.
I considered the .getItems() method, but there doesn't seem to be a general .addItem() method I could use on the new form. Would I have to go through the painstaking process of having to identify each item type, and specify how the details of each one should be copied to the new form, including things like point values of a question and whether or not the question is required?
I want to import from forms that have all kinds of content: video, images, multiple choice questions, grid questions, number scale questions, etc. I feel that if I have to specify the details of each item type, it would take too long, and I would be bound to miss something or run into an error that may be impossible to solve. Is there not an easier way?
And if specifying each item type is what I have to do to import everything properly, has someone else created that code already that I can re-use?
Issue:
In the current stage, unfortunately, it seems that Forms Service cannot copy all items. Ref1, Ref2 Ref3. And, unfortunately, moveItem can be used for the same Google Form as you say.
Workaround:
In your situation, as a workaround, how about copying the source Google Form? And, when there are some items you want to remove, you can remove them. I thought that this process can be achieved by Google Apps Script.
But, I'm not sure about your actual Google Form. So I'm not sure whether this is a suitable method.
Future:
Recently, Google Forms API was announced. Ref When this API got to be able to be used, your goal might be able to be achieved by retrieving the object from Google Form. Unfortunately, I'm still not sure about the detail of it.

Wordpress custom post type and Google maps API

I have programmed custom post type inside Wordpress and I am using it for submission of properties inside system.
I would like to add google maps functionality where based on adress that someone enters, he automatically gets a place on the map, all on google maps.
Is that possible? How to render correct place on google maps based on html form inut? Im just loking for an idea on this, if someone can give me a hint I would be thankful.
you most likely need to implement a small plugin that defines a google map shortcode, with the field with location as a parameter.
The reason is that you need to include libraries etc that are not needed for all other pages, and the ability to put the map wherever you need it within said post.

Pull Suggestion out of Google Maps Autocomplete

I'm instantiating a google maps Autocomplete box, as such:
autocomplete = new google.maps.places.Autocomplete(input, options);
Now, when a user begins typing and the list of suggestions appears, if a user simply presses Enter I want the number one prediction to be used as the search term.
For example, when a user searches: London, I want to pull out and send London, United Kingdom - simply by the user pressing Enter.
I can pull out that prediction using (with the latest V3.11):
autocomplete.gm_accessors_.place.Gc.predictions[0].wg
However, this obviously relies on the "compiled" object names, such as Gc and wg which will change as Google updates their codebase.
What is the correct way of doing this? Is it supported by the Autocomplete API?
Notice
Please star this issue on Google to get a solution:
https://code.google.com/p/gmaps-api-issues/issues/detail?id=4945
there is no correct way when using places.Autocomplete, it's not implemented so far.
What you can do: the API creates the dropdown, a div with className "pac-container", and within that div for each prediction a div with the className "pac-item", you may use the text of the first .pac-item as value for the input.
A correct way would be to request the Places Autocomplete Service , but then you need to create the dropdown on your own.

Search box UI in apps script

We are in implementing a search box for searching comments in Google sites with the help of Google Apps Scripts, which is stored in the scriptdb.
In the UI side now we implemented a textbox and a listbox below that to list the suggestions from the scriptdb, It works as shown in the below img.
And now i'm trying to make the typed string to bold in the listbox below to give some more flexibility to user to find where the exact string is in the suggestion box. Like in the below image.
And In a listbox control, We can set styleAttribute to make bold or change font color for the added item.
Ex:
app.createListBox().addItem("SELECT").setStyleAttribute("color","red");
The above statement will set the style attribute for all the list box items.
But How to set style attribute for a particular character in the added item
listbox.addItem("HELLO world")
The issue is to set style attribute for only the upper case letter of the above addItem in the list box.
It ll be more useful and reduce the developers complexity in the Google Apps Script.
And also I raised this as enhancement in the issue tracker in issue 2293.
If is there any more work around, Pls suggest here. It ll be helpful for everyone, who is in need of this feature.
Tnx,
Chocka.
There is no workaround in UiService. You can use HtmlService which allows custome HTML and javascript code