I spent the whole day trying to find a solution for following requirement:
I have a list widget that is used the changed the operation mode of the heating. Possible options are coming from the state description of the item. This is working perfectly with the oh-label-item widget and the action=options.
But now I want to change a) the text from “Canel” to a localized version (“Abbrechen” in german) and b) add one more option “Details” to open a new page with detailed configuration options of the heating.
I understood this is not possible and tried to use popover as the action and open a custom widget as popover. This is working basically, but I can not get a look and feel like for the build in options. Esp. the position is completely different and when I try to modify it with classes and CSS I always break everything Another option might be to use f7-actions but can’t get this to work at all.
Thus having said I’m not a web developer at all so asking if someone has solved a similar task already and can give some hints or examples.
The easiest way to replicate that appearance is to use an oh-list and populate that list with oh-list-item components each of which has its listButton property set to true (then, of course, set the textColor property to red for the Abbrechen list item). Here’s one example where I use this sort of thing in a popover:
Thanks a lot @JustinG
With your help I made a big step forward. Just playing with some style properties to bring to popover to the bottom of the screen like in the options popover.
Only thing that doesn’t work is closing the popover by clicking one of the options. Both options from your sample code (popoverClose: true / popoverClose: .<class_name>) have no effect. Any idea on this?
Ah yes, sorry I forgot those were there. This version of the popover doesn’t need to close on click and those were holdovers from an earlier version. The problem you are encountering is that when listButton is true, the popoverClose etc. properties actually aren’t passed through to the underlying f7-list-button so they won’t work in this case. It becomes a just a little more complex to get the same styling if you want to have the popover close on click. You have to replace the oh-list-item with an oh-link inside of an f7-list-button like this:
- component: f7-list-button
slots:
default:
- component: oh-link
config:
action: popup
actionModal: widget:popup_tod_wake_up
popoverClose: true
text: Wake Up
textColor: blue
Note: now you’ll need to add the textColor: blue because for the link the default color is red.