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;
  • 相关阅读:
    mybatis 版本问题
    sonar-maven-plugin问题
    spring容器&classLoader
    Mybatis知识点整理
    防重复提交的方式汇总
    秒杀系统设计整理
    MySQL事务隔离级别&锁
    disruptor解读
    springboot 2.x集成log4j2调试日志无法关闭问题
    Java并发——volatile
  • 原文地址:https://www.cnblogs.com/a973692898/p/11691973.html
Copyright © 2011-2022 走看看