zoukankan      html  css  js  c++  java
  • easyui combobox动态默认选项设置

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
       <!-- 引入JQuery -->
      <script type="text/javascript" src="../JQuery-EasyUI-1.5.1/jquery.min.js"></script>
      <!-- 引入EasyUI -->
      <script type="text/javascript" src="../JQuery-EasyUI-1.5.1/jquery.easyui.min.js"></script>
      <!-- 引入EasyUI的中文国际化js,让EasyUI支持中文 -->
      <script type="text/javascript" src="../JQuery-EasyUI-1.5.1/locale/easyui-lang-zh_CN.js"></script>
      <!-- 引入EasyUI的样式文件-->
      <link rel="stylesheet" href="../JQuery-EasyUI-1.5.1/themes/default/easyui.css" type="text/css"/>
      <!-- 引入EasyUI的图标样式文件-->
      <link rel="stylesheet" href="../JQuery-EasyUI-1.5.1/themes/icon.css" type="text/css"/>
     
    </head>
    <body>
       <table id="dg" title="My Users" class="easyui-datagrid"
        style=" 550px; height: 250px" 
        toolbar="#toolbar" rownumbers="true" fitColumns="true"
        singleSelect="true">
        <thead>
            <tr>
                <th field="firstname" width="50">First Name</th>
                <th field="lastname" width="50">Last Name</th>
                <th field="phone" width="50">Phone</th>
                <th field="email" width="50">Email</th>
            </tr>
        </thead>
    </table>
    <div id="toolbar">
        <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="newUser()">New User</a>
        <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="editUser()">Edit User</a>
        <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="destroyUser()">Remove User</a>
    </div>
       
     <div>
         <select id="cc" class="easyui-combobox" name="dept" style="200px;">
         </select>
     </div> 
      <script type="text/javascript">
           var sq=2;
           $('#cc').combobox({
               data:[{text:'AAA',value:'0',selected:true},
                     {text:'BBB',value:'1'},
                     {text:'CCC',value:'2'},
                     {text:'DDD',value:'3'}],
    onLoadSuccess:function(){
    $(this).combobox('select',sq);
    } });
    </script> </body> </html>
  • 相关阅读:
    冒泡排序
    Objective-C 命名规范
    时间轴的制作
    CocoaPods 哪些事
    消息转发机制入门篇
    架构
    算法学习
    AutoLayout自动布局
    网络学习
    HDU 3832 Earth Hour (最短路)
  • 原文地址:https://www.cnblogs.com/conserdao/p/6936450.html
Copyright © 2011-2022 走看看