EasyUI Forum
November 05, 2025, 12:36:54 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: make non-editable combobox drop down on click in text region?  (Read 19808 times)
jpierce
Jr. Member
**
Posts: 73


View Profile
« on: September 12, 2013, 11:35:45 AM »

What would be the best way to make a non-editable combobox drop down when you click on the text regions (instead of just the dropdown arrow)?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 12, 2013, 05:37:45 PM »

Bind 'click' event handler to the textbox and call 'showPanel' method to display drop down list panel in this event handler.
Code:
var cc = $('#cc').combobox({...});  // create combobox component
cc.combobox('textbox').bind('click',function(){
  cc.combobox('showPanel');
});
Logged
jpierce
Jr. Member
**
Posts: 73


View Profile
« Reply #2 on: September 16, 2013, 09:26:36 AM »

Thanks!  I added a little so that the click will toggle between open and closed, like most comboboxes do:
Code:
    var cc = $('#cc ');
    cc .combobox('textbox').bind('click', function() {
        if (cc .combobox('panel').parent().css('display') === 'none') {
            cc .combobox('showPanel');
        }
        else {
            cc .combobox('hidePanel');
        }
    });
Logged
arma
Full Member
***
Posts: 110


View Profile
« Reply #3 on: December 01, 2013, 04:04:43 PM »

How to extend this so it applies to any combobox by default?
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: December 01, 2013, 05:27:29 PM »

This topic has solved this problem.
http://www.jeasyui.com/forum/index.php?topic=2481.0
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!