zoukankan      html  css  js  c++  java
  • EasyUI 对话框弹出文件输入框

      目前用的EasyUI的dialog,要实现弹出文件输入框(或者其他输入框和对话框),我的实现方案是,首先写一个close的div,然后里面就是样式和输入框的一些代码和一个确定按钮,然后页面上一个按钮,功能是open这个dialog,然后在dialog页面完成输入操作,然后dialog的确定按钮绑定的是提交dialog的form操作。

      

    <div id="fileImport" class="easyui-dialog" title="请上传文件"
            style=" 450px; padding: 10px 20px; height: 150px;" closed="true"
            buttons="#dlg-buttons">
            <form id="importfile"
                action="<%=request.getContextPath()%>/UploadModelCatecodeFile"
                method="post" enctype="multipart/form-data"
                style="margin-top: 20px; margin-left: 20px;">
                <div class="fitem">
                    <table border="0">
                        <tr>
                            <td><label>选择文件:</label> <input type="file"
                                name="uploadCatecodeFile"></td>
                            <td><a href="#" class="easyui-linkbutton"
                                iconCls="icon-excel-import" id="importDataBtn2">确定导入</a></td>
                        </tr>
                    </table>
                </div>
            </form>
        </div>
    close的div
    $('#importDataBtn1').bind('click',function(){
                    $('#fileImport').window("open");
                });
    页面按钮绑定open该dialog的功能
    $('#importDataBtn2').bind('click',function(){
                    $.messager.confirm("确认", "确认要导入车型Catecode数据吗?", function(r){
                        if(r){ 
                            $('#importfile').form('submit', {
                                success:function(data){
                                    var jsonObj = eval('(' + data + ')');
                                    if(jsonObj.flag==1){
                                        alert('导入车型Catecode数据成功!');
                                    }
                                    else{
                                        alert(jsonObj.flag);
                                    }
                                },
                                onSubmit: function(param){   // 额外参数
                                }   
                            }
                            );
                         }
                    }); 
                });
    提交功能
  • 相关阅读:
    poj2954
    bzoj1863
    bzoj2002
    bzoj1389
    [POJ3041] Asteroids(最小点覆盖-匈牙利算法)
    [POJ2594] Treasure Exploration(最小路径覆盖-传递闭包 + 匈牙利算法)
    [POJ2446] Chessboard(二分图最大匹配-匈牙利算法)
    [luoguP1266] 速度限制(spfa)
    [luoguP1186] 玛丽卡(spfa)
    [luoguP1027] Car的旅行路线(Floyd)
  • 原文地址:https://www.cnblogs.com/yanghanwen/p/10425430.html
Copyright © 2011-2022 走看看