zoukankan      html  css  js  c++  java
  • layui 添加功能

      

    case 'add':
                    layer.open({
                        type : 1,
                        title : "添加页面",
                        area : [ '580px', '640px' ],    //设置弹出页面的宽高
                        offset : '20px',                //设置相对位置(偏移)
                        content : $("#add_project"),    //表单所在的那个ID,简单的来说就是要填写的input框等
                        cancel : function() {
                            // 你点击右上角 X 取消后要做什么
                            setTimeout('window.location.reload()', 1); //点击右上角的X,关闭页面。然后进行刷新页面;
                            
                        },
                        success : function() {                            //回调
                            $(':input', '#add_project').not(':button,:submit,:hidden,:radio').val('').removeAttr('checked').removeAttr('selected'); 
                            form.render();                                //重新渲染
                            form.on('submit(submitUpdProject)', function() { //点击提交后,回调;
                                var jsonEntity = {};
                                var entity = $("form").serializeArray()
                                $.each(entity, function() {
                                    if (this.name == "createTime") {
                                        var a = new Date();
                                        jsonEntity[this.name] = timeDate(a);
                                    } else {
                                        jsonEntity[this.name] = this.value;
                                    }
                                });
    
                                zsg(_url, jsonEntity);                 //url是路径,调用后台方法的路径
                                setTimeout('window.location.reload()', 1000);    //刷新页面
                                layer.closeAll();
                                return false;
                            });
    
                        }
                    });
                    break;
  • 相关阅读:
    HDU 1594 find the max
    mongoose 数据库操作2
    我也来开发2048之终极奥义
    cocos2d-x 2.2.0 怎样在lua中注冊回调函数给C++
    windows常用运行命令
    机器学习——Pandas库
    搭建靶场环境
    Ubuntu快速安装MSF
    docker 基本使用
    linux下杀死进程
  • 原文地址:https://www.cnblogs.com/a973692898/p/11691973.html
Copyright © 2011-2022 走看看