EasyUI Forum
April 30, 2024, 08:29:29 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: Combobox default Text  (Read 8592 times)
dtucker
Newbie
*
Posts: 11


View Profile Email
« on: February 05, 2014, 06:31:45 AM »

How can I set default text to notify the user on what to do? Example would be to set text such as "Select an Option" as the first option but obviously wouldn't fire an event.

Here's my current code:

Code:
$('#cboParentOrganization').combobox({
            url:'Organization/GetOrganizationByRole.php',
            valueField:'orgid',
            textField:'orgname',
            panelHeight:'190',
            width:'350',
            onSelect: function(rec)
            {
             
            }
        });

Thanks
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: February 05, 2014, 07:00:48 AM »

The data item with 'selected' set to true will be auto selected after loaded data successfully. Please refer to this example http://www.jeasyui.com/demo/main/index.php?plugin=ComboBox&theme=default&dir=ltr&pitem=Load%20Dynamic%20ComboBox%20Data.
Logged
dtucker
Newbie
*
Posts: 11


View Profile Email
« Reply #2 on: February 05, 2014, 07:06:23 AM »

Thanks, but that doesn't seem to show how to put text in a combobox to insert text to instruct the user to "Select". That selected a value which I don't see how it instructed the combobox to select a value.

Thanks
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #3 on: February 05, 2014, 08:03:48 AM »

Do you wish to add text prompts to the textbox? If so, please try the code below:
Code:
$('#cboParentOrganization').combobox({...});
$('#cboParentOrganization').combobox('textbox').attr('placeholder','Select an Option');
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!