EasyUI Forum
September 14, 2025, 01:33:39 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Navigation Buttons inide combobox  (Read 6716 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« on: March 25, 2015, 04:50:12 AM »

Hi;

I am running short of space and have 2 small buttons on the right of many comboboxes "<" ">" in order to navigate back and forth through the records rather than clicking and selecting the combo, it works well.

But I would like to move these 2 little buttons (which look similar to the dropdown combo arrow only pointing left and right) into the right hand side of the combobox and only show them when the user hovers the mouse over them, can this be done ?

I see under the demo section there is an example of adding extra icons to a textbox/combo, but these consume text width inside the combobox and I cannot afford to loose any text width, so the icons would need to be overlaid ontop of the text and only be visible when they are hovered over.

The intention would be to have these buttons added to any combo with a class name of "navi" so when I add a new combo, I can switch on this feature just by adding the class rather than by hard-coding each occurrence of the combo.

« Last Edit: March 25, 2015, 05:00:17 AM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: March 25, 2015, 08:07:53 AM »

You can add extra icons with multiple class name. The code below shows how to add an icon with 'navi' class, which is hidden and only show when hovering on it.
Code:
<style type="text/css">
.navi{
opacity: 0.0;
}
.navi:hover{
opacity: 0.6;
}
</style>
<script>
$(function(){
$('#cc').combobox({
icons:[{
iconCls:'icon-search navi'
}]
})
})
</script>
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!