Select-or-Die演示11种美化下拉框select方法


在线预览

下载地址

在线实例
 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<div  class = "main" >
             <div  class = "mianc" >
                 <h1>默认</h1>
 
                 <!-- Demo start -->
                 <div  class = "select" >
                     <select  class = "myselect" >
                         <option value= "交互设计" >交互设计</option>
                         <option value= "视觉设计" >视觉设计</option>
                         <optgroup label= "开发" >
                             <option value= "前端开发" >前端开发</option>
                             <option value= "后端开发" >后端开发</option>
                         </optgroup>
                         <option value= "用户研究" >用户研究</option>
                         <option value= "产品经理" >产品经理</option>
                     </select>
                 </div>
                 <!-- Demo end -->
             </div>
         </div>
         <style>
             * { margin: 0; padding: 0;}
             html, body { height: 100%; overflow: hidden;}
             body { font-family: Consolas,arial, "宋体" ;}
             .menu { position: absolute; left: 0; top: 0; width: 200px; height: 100%; #ccc; font-family: Consolas,arial,"宋体";}
            .menuc { height: 100%; overflow-x: hidden; overflow-y: auto;}
            .menu span { display: block; height: 100px;}
            .menu a { display: block; height: 40px; margin: 0 0 1px 2px; padding-left: 10px; line-height: 40px; font-size: 14px; color: #333; text-decoration: none;}
            .menu a:hover { #eee;}
            .menu .cur { color: #000; }
            .main { height: 100%; margin-left: 200px;}
            .mianc { position: relative; height: 100%; overflow-x: hidden; overflow-y: auto;}
            .main h1 { width: 900px; margin: 40px auto; font: 32px "Microsoft Yahei";}
            .explain, .sucaihuo-explain { margin-top: 20px; font-size: 14px; text-align: center; color: #f50;}
        </style>
 
转载:http://www.cnblogs.com/niuboren/p/6108170.html

转载于:https://www.cnblogs.com/wang1593840378/p/6124081.html

在 JeeCG Datagrid 中双击行进行编辑时,可以使用 EasyUI 的 ComboGrid 组件来实现下拉框多选。 首先,在需要进行多选的列中使用 ComboGrid 组件,例如: ``` {field:'city',title:'City',width:80,editor:{ type:'combogrid', options:{ panelWidth:400, idField:'id', textField:'text', url:'get_cities.php', multiple:true, columns:[[ {field:'id',title:'ID',width:60}, {field:'text',title:'City Name',width:120}, {field:'country',title:'Country',width:100} ]] } }} ``` 在上面的代码中,我们将一个名为 `city` 的列使用了 ComboGrid 组件,并设置了 `multiple:true` 以启用多选功能。同时,我们也设置了 ComboGrid 组件的 `url` 属性来指定获取下拉框选项的数据源。 接下来,我们需要编写 `get_cities.php` 文件来获取下拉框选项的数据源。在这个文件中,我们可以使用 PHP 代码从数据库中获取城市列表,然后将其以 JSON 格式返回给前端页面。 示例代码: ```php <?php $host = 'localhost'; $user = 'root'; $pass = 'password'; $dbname = 'test'; // Connect to database $conn = mysqli_connect($host, $user, $pass, $dbname); if (!$conn) { die('Could not connect: ' . mysqli_error()); } // Retrieve city list from database $result = mysqli_query($conn, 'SELECT * FROM cities'); // Convert result to JSON format $rows = array(); while ($r = mysqli_fetch_assoc($result)) { $rows[] = $r; } echo json_encode($rows); // Close database connection mysqli_close($conn); ?> ``` 在上面的 PHP 代码中,我们首先连接到数据库,然后从 `cities` 表中获取城市列表,并将其转换为 JSON 格式返回给前端页面。最后,我们关闭数据库连接。 当用户在 JeeCG Datagrid 中双击行进行编辑时,会弹出一个下拉框供用户选择。用户可以通过在下拉框中进行搜索或直接选择多个选项来完成多选操作。用户选择的选项会以逗号分隔的字符串形式保存在 JeeCG Datagrid 中。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值