Dropdowns are useful, but they would be even more useful if the dropdown options could be formatted. For example, using bold or italic text for various selections, or changing the background color of other options on the dropdown display.
It's easy to have a cell formatting change according to the dropdown selected, but that's not what I'm trying to do. I want the formatting of the the dropdown items to be different than simple plain text.
I'm not sure changing the colour of data validation options is possible, but you can exploit the fact that Unicode fonts include italic and bold versions in their extended character sets, and use these characters instead of the usual ones to achieve some of what you want. Use an online tool like (for instance) https://yaytext.com/bold-italic/ to give you the bold/italic versions of your required text options, and add these to your validation list.
It sounds like you are asking for a way to change the appearance of the control that appears when you click the dart in a drop-down cell. The built-in controls in Google Sheets cannot be customized that way.
To implement your own custom controls, use Apps Script to implement a custom dialog box or a sidebar.
A simple script that, for example by selecting a value in a column 5 (change), changes the formatting of the text? Or do you want the text in the validation to be changed?
function onEdit(e) {
if(e.range.getRow()>1 && e.range.getColumn() ==5){
e.source.getActiveRange()
.setFontSize(11)
.setFontWeight('bold')
.setFontStyle('italic')
.setFontLine('line-through')
.setFontColor('#ff0000')
.setBackground('#ffff00')
};
}
Related
I have a richtext textbox control that works nicely enough. I can change the formatting of the text if I use the mouse to select some text--then the contextual formatting menu appears and I can select the various formats that I want (e.g., bold, ital., highlighting color, text color, etc.).
However, I'd like the formatting menu to appear at other time, for example, on right-click, or, when text is selected using cursor keys, or, when some key combination or command button is clicked.
I've searched for how to use VBA to bring up the formatting context menu but have found nothing.
Anyone know the VBA code to bring up the formatting context menu for a MS Access richtext textbox control?
That is not possible I'm afraid.
Two common solutions are adding the formatting options to the ribbon, and creating your own custom formatting menu, in combination with hotkeys. (Some already present, such as Ctrl-b for bold.)
Let me know if you need any help with either direction.
Quick question here. I am creating a web app using MVC. I've noticed when I add input boxes to pages, they save previous entries in a dropdown fashion, like so:
While this IS handy, I'd like to know a couple things:
How/Where are these previous entries being saved? Is this my browser or an MVC thing?
If need be, how can I override this default behavior?
Thanks!
I'm not sure what's in your specific project, but it could be one of three things:
Some browsers, if you submit a form, remember the submitted values and automatically make inputs autocomplete. The autocomplete HTML attribute on forms and inputs can help to control that.
HTML 5 has a datalist element which lets you associate a list of options with an input, so autocomplete can be implemented manually.
There may be some JavaScript, potentially paired with AJAX doing this autocomplete.
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
I have tried searching for this but I do not know the name of the control or UI so I am not having any luck. I'd like to know if there is a name for this UI and if you know of a good link to sample html that would be ideal.
It will be used inside of a jQuery UI dialog box as well as on a standard page within a web app.
Thanks!
You need to use a two-sided multi-select list...
The jQuery two-sided multi-select list converts a normal drop down list into the mock-up you've posted and automatically moves selected items over to the right-hand list as well as adding buttons for movement (plus you can double-click items to move them back and forth).
i have a selectbox with Country code values, they have a "short" label (2 letters) and a "long" label (full name).
when not selected i want the "short" label to appear, but when clicked and the full selection appears to chose from the "long" labels should appear in the dropdown.
is this even possible with html? or do i need to render a textfield and draw the selction over it using js/css?
is there maybe an advanced component available in any framework?
It's not possible with pure HTML. This may call for a Javascript based SELECT replacement.
Check out these resources:
11 jQuery Plugins to Enhance HTML Dropdowns
(Wanted to post examples for each JQuery, Prototype and Mootools based plugins to avoid Frameworkism, but can't find any quickly right now)
It might be simpler to wire up a textbox with a js drop down that has the short label and populates with the full name. There are a ton of them out there that already do most of this, it would just be a couple of tweaks for the full effect.