BootStrap穿梭框

<%--
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>

    <link rel="stylesheet" type="text/css" href="../bootstorp/css/bootstrap.css">
    <script type="text/javascript" src="../js/jquery-2.1.4.js"></script>
    <script type="text/javascript" src="../bootstorp/js/bootstrap.js"></script>
</head>
<body>
<script>
    $(function(){
        var j_all_area = $("#sel_all_area"), j_selected_areas = $("#sel_selected_areas");
        $("#btn_select_all_area").click(function(){
            var selectedAreaArray = [];
            j_all_area.find("option").each(function(i){
                selectedAreaArray[i] = $(this).val();
                $(this).appendTo(j_selected_areas);
            });
            doSubmit('add',selectedAreaArray.toString());
            return false;
        });
        $("#btn_choose_selected_area").click(function(){
            var selectedAreaArray = [];
            j_all_area.find("option:selected").each(function(i){
                selectedAreaArray[i] = $(this).val();
                $(this).appendTo(j_selected_areas);
            });
            doSubmit('add',selectedAreaArray.toString());
            return false;
        });
        $("#btn_remove_selected_area").click(function(){
            var selectedAreaArray = [];
            j_selected_areas.find("option:selected").each(function(i){
                selectedAreaArray[i] = $(this).val();
                 $(this).appendTo(j_all_area);
            });
            doSubmit('del',selectedAreaArray.toString());
            return false;
        });
        $("#btn_remove_all_area").click(function(){
            var selectedAreaArray = [];
            j_selected_areas.find("option").each(function(i){
                selectedAreaArray[i] = $(this).val();
                 $(this).appendTo(j_all_area);
            });
            doSubmit('del',selectedAreaArray.toString());
            return false;
        });

    })

    function doSubmit(select_type,roleids){
        var userid = $("#userid").val();
        $.post("doroledefine",{userid:userid,roleids:roleids,type:select_type},function(result){
            if (result == "error") {
                layer.msg('更新失败!', {
                    icon: 2
                })
            }else{
                initParams();
                layer.msg('更新成功!', {
                    icon: 1
                })
            }
        });
    }

</script>

<fieldset>
    <input type="hidden" name="userid" value="${userid }" id="userid"/>
    <table class="table table-bordered dchannel-table">
        <tbody>
        <tr class="item-default">
            <td align="right" style="width: 50%;">
                <select id="sel_all_area" multiple="multiple" size="10" style="width:100%;">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                </select>
            </td>
            <td style="width: 50px;" valign="middle">
                <button type="button" class="btn btn-default btn-small" id="btn_select_all_area"><span class="glyphicon glyphicon-forward"></span></button>
                <button type="button" class="btn btn-default btn-small" id="btn_choose_selected_area"><span class="glyphicon glyphicon-chevron-right"></span></button>
                <button type="button" class="btn btn-default btn-small" id="btn_remove_selected_area"><span class="glyphicon glyphicon-chevron-left"></span></button>
                <button type="button" class="btn btn-default btn-small" id="btn_remove_all_area"><span class="glyphicon glyphicon-backward"></span></button>
            </td>
            <td style="width: 50%;">
                <select id="sel_selected_areas"  multiple="multiple" size="10" style="width:100%;">
                
                </select>
            </td>
        </tr>
        </tbody>
    </table>
</fieldset>
</body>
</html>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值