EasyUI 对话框弹出文件输入框

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

  

<div id="fileImport" class="easyui-dialog" title="请上传文件"
        style="width: 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){   // 额外参数
                            }   
                        }
                        );
                     }
                }); 
            });
提交功能

 

转载于:https://www.cnblogs.com/yanghanwen/p/10425430.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值