How to achieve drop down selection window in Ruby on Rails - ruby-on-rails

I want to achieve a selection box in the drop down window.(I'm using something like
<%= f.select(:season, options_for_select(['spring/fall', 'winter', 'summer'], 'spring/fall'))%>
for the selection box for now)
In this window, I want to have many icons. The user can select one of these icons. And the selected icon will be saved in the database as one attribute of the object.
Can I do this without JavaScript?

Yes it is possible to use the background-image property to set icons in a dropdown, but apparently it only works in Firefox
See this question for discussions of how to do it with JS putting images with options in a dropdown list

Related

Vaadin 14: Exchange Combobox Dropdown icon

In a Vaadin 14 application I wanted to exchange this standard icon at a combobox:
for another icon (and achieved the goal, but I think that my way is not the best / nicest).
My full use case is assembling a list, some buttons and a combobox to create this sortable multi-select-list:
The user can add a new value to the list by selecting the new value in the combobox below.
To exchange the standard icon for the combobox (--lumo-icons-dropdown = \ea18, an arrow showing down) for a plus-icon, I used this code: combobox.getElement().getStyle().set("--lumo-icons-dropdown", "\"\\ea23\""); (yes, all the quotes and backslashes are as shown)
This works fine (as you can see in the screenshot), but it feels incorrect to overwrite an icon.
Is there another (better) way to exchange the standard dropdown icon at a Vaadin combobox for another icon?

adjust width of select2 if/when it opens

I have a select2 in a bootstrap v4 dropdown. I load the options into the select2 when the dropdown is triggered.
The select2 contains some items with long names, and if the select2 is opened, I would like to show the full width even though that is wider than the dropdown.
I have tried select2({width: 'resolve'}) and select2({width: '200%'})
in the select2:opening and select2:open event handlers but they throw exceptions. If I initialize the select2 with width:200%, it is too big if it isn't opened.
Is this possible? Any ideas? Thanks.
It sounds like you are looking for the dropdownAutoWidth option. This should automatically resize the dropdown based on the available room.

Exporting data from FileMaker GO on an iPad

I am trying to export data from all records in a FM database on FM GO on an iPad in an xlsx format. I can export ok apart from layouts which have a tab control layout - these layouts only seem to export the data from the tab viewed rather than all the tabs on the screen. I know I have made this work before so all the fields appear in the "select fields" list but now I can only seem to get the current tab fields to show in that list when exporting. Can anyone help?
Thanks
Penny
On the desktop, when you export records there is a drop-down list with two options: fields on the layout and all fields related to the content. Only fields from the visible tabs will be included in the first option. In FileMaker Go the behaviour is the same, but you do not have a drop-down and it defaults to the fields placed on the layout. Simple workaround is to place missing fields on the layout and make them non-editable and invisible. I tested on FM Go 11, but I do not think this functionality changed in later versions. In 12/13 you can try to place the fields to the right of the layout border, not sure if it works.

Phonegap/iOS — Disable popup menu for selected text

I have used -webkit-user-select to limit selections to text, and now I'd like to prevent iOS from popping up the default menu that comes with text selections. In other words, I want users to be able to select text, but I don't want the copy/define menu to show up. Either that, or I'd like to be able to modify that menu with my own options. Is there a way to do this?
Have a look at this answer: iPhone/iPad context menu
You will probably need to either hack the PhoneGap source and recompile the framework or write a plugin to do what you need.
You can try disable native callout with this css property:
-webkit-touch-callout: none;

Customizing the look and feel of Orbeon forms

We would like to be able to customize the areas outside the form elements area itself, such that customers can have all their forms including the areas surrounding the form in their own style. For instance in the area on the top we would like to have a different color and we would like to replace the Orbeon logo by the logo of the customer. Also we would like to hide/remove/customize some buttons that appear below the form. For instance we don't need the buttons for PDF, Email and Close and we want to change the text in the Save button to Submit.
Is that possible? If so, how do we do that? Is there some instruction somewhere for this?
Yes, you can do all of this through properties:
You can change the color at the top by overriding the .fr-top rule defined in form-runner-orbeon.css. For more on how to override CSS, see: Default CSS.
You can replace or remove the default logo with the oxf.fr.default-logo.uri.*.* property. See Default logo.
You can choose which buttons are shown on the Form Runner "details" page by overriding the oxf.fr.detail.buttons.*.* property. See Buttons on the detail page.
You can change the label on a button by overriding resources. See Overriding resources.
I was faced with the problem to change the icon in the browser address and found the answer of Alessandro Vernet:
http://discuss.orbeon.com/page-address-bar-browser-icon-td4660752.html .
But this solution has the drawback that I had to change the orbeon-form-runner.jar, and this with every new orbeon forms release, what I wanted to avoid.
So the idea was to give my icons the same name as the orbeon icons and to load them in a corresponding directory of the resource directory.
So I named my icon orbeon-icon-16.ico and orbeon-icon-16.png and loaded the two files in orbeon/WEB-INF/resources/ops/images.
For Firefox this was OK, but IE continued to show the orbeon icon. Then I noticed that in orbeon-core.jar there where also the 32 pixel icon.
So I added the two files orbeon-icon-32.ico and orbeon-icon-32.png and than also IE was showing our icon.

Resources