Search box UI in apps script

2019-04-17 12:12发布

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.

WORK AROUND FOR SEARCH BOX

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.

enter image description here

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.

1条回答
疯言疯语
2楼-- · 2019-04-17 12:38

There is no workaround in UiService. You can use HtmlService which allows custome HTML and javascript code

查看更多
登录 后发表回答