Select Input gizmo with info popup? #883
Replies: 3 comments 2 replies
-
It seems like you are looking for a tooltip functionality correct? Which version of Tethys are you using? I just looked at the example app in a Tethys v4 environment and it has the following code: save_button = Button(
display_text='',
name='save-button',
icon='save',
style='success',
attributes={
'data-bs-toggle':'tooltip',
'data-bs-placement':'top',
'title':'Save'
}
) The result on hover effect is shown in this image. |
Beta Was this translation helpful? Give feedback.
-
I don't think there's a dropdown gizmo so you'll need to implement this in the html. Using the Bootstrap 5 attribute syntax, you can use <div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown Menu
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#" data-bs-toggle="tooltip" data-bs-target="top" title="Option 1">First Option</a></li>
<li><a class="dropdown-item" href="#" data-bs-toggle="tooltip" data-bs-target="top" title="Option 2">Second Option</a></li>
<li><a class="dropdown-item" href="#" data-bs-toggle="tooltip" data-bs-target="top" title="Option 3">Third Option</a></li>
</ul>
</div> If it isn't working for you then you may have a different version of Bootstrap. I don't remember which version they changed their data attribute naming convention. |
Beta Was this translation helpful? Give feedback.
-
Sorry, I didn't read clearly that you were trying to use a Select Input gizmo. The It would look something like <div class="input-group mb-3">
<input type="text" class="form-control" aria-label="Text input with dropdown button">
<button class="btn btn-secondary dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">
Dropdown Menu
</button>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="#" data-bs-toggle="tooltip" data-bs-target="top" title="Option 1">First Option</a></li>
<li><a class="dropdown-item" href="#" data-bs-toggle="tooltip" data-bs-target="top" title="Option 2">Second Option</a></li>
<li><a class="dropdown-item" href="#" data-bs-toggle="tooltip" data-bs-target="top" title="Option 3">Third Option</a></li>
</ul>
</div> Then you'll need to add the onclick listeners in your javascript to set the input's value. |
Beta Was this translation helpful? Give feedback.
-
I am using the Select Input gizmo to allow users to chose various forecast outputs and we would like to have a mouseover event display a few words about what that type of forecast it is. Is this possible with the Select Input gizmo? It looks like it may be possible with the attribute option. From the documentation I see this:
A dictionary representing additional HTML attributes to add to the primary element (e.g. {"onclick": "run_me();"}).
I assume that the run_me() is a javascript function? Are there any working examples of this feature? It would be idle to place a small info button on each line of the dropdown but i am not sure if this is possible.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions