关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、3102411850 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 9813|回复: 3

jeecg弹出框默认最大化(3.3.2已经支持标签设置了!)

[复制链接]
发表于 2013-8-21 10:36:46 | 显示全部楼层 |阅读模式
本帖最后由 GIN 于 2013-9-2 11:30 编辑
新版本(9月份版本)已经可以在标签中设置啦!
   <t:dgToolBar operationCode="add" title="录入" icon="icon-add" url="jeecgDemoController.do?addorupdate" funname="add" width="700" height="500"></t:dgToolBar>


另外如果想要弹出框最大化,将width或者height其中一项设置为"100%" 就可以了!

目前JEECG中的弹出框是默认大小的,如何将弹出设置为初始最大化呢?

情况1:将所有的弹出框都设置为初始最大化

/WebRoot/plug-in/tools/curdtools.js

function createwindow(title, addurl,width,height) {
        //update-begin--Author:jueyue  Date:20130811 for:动态设置大小
        width = width?width:600;
        height = height?height:400;
        //update-end--Author:jueyue  Date:20130811 for:动态设置大小
        if(typeof(windowapi) == 'undefined'){
                $.dialog({
                        content: 'url:'+addurl,
                        lock : true,
                        width:width,
                        height:height,
                        title:title,
                        opacity : 0.3,
                        cache:false,
                    ok: function(){
                            iframe = this.iframe.contentWindow;
                                saveObj();
                                return false;
                    },
                    cancelVal: '关闭',
                    cancel: true /*为true等价于function(){}*/
                }).max();//这里加上这句
        }else{
                W.$.dialog({
                        content: 'url:'+addurl,
                        lock : true,
                        width:width,
                        height:height,
                        parent:windowapi,
                        title:title,
                        opacity : 0.3,
                        cache:false,
                    ok: function(){
                            iframe = this.iframe.contentWindow;
                                saveObj();
                                return false;
                    },
                    cancelVal: '关闭',
                    cancel: true /*为true等价于function(){}*/
                });
        }
        
}
情况2.只将某个单独的页面弹出设置为最大化

step.1 找到要设置弹出最大化的按钮或者操作

例如: <t:dgToolBar operationCode="add" title="录入" icon="icon-add" url="jeecgDemoController.do?addorupdate" funname="add"></t:dgToolBar>

step.2 这种情况add函数是写在crudtools.js里面的,我们将这个函数从公用js中copy出来到列表页面上。
(记得将函数重命名,否则会产生问题)

function add1(title,addurl,gname) {
        gridname=gname;
       createwindow(title, addurl);
}
step.3 将createwindow(title, addurl);替换为上例中的createwindow的代码体,并改写dialog的方式为.max()






















 楼主| 发表于 2013-9-1 20:20:37 | 显示全部楼层
新版本已经可以在标签中设置啦!

   <t:dgToolBar operationCode="add" title="录入" icon="icon-add" url="jeecgDemoController.do?addorupdate" funname="add" width="700" height="500"></t:dgToolBar>


另外如果想要弹出框最大化,将width或者height其中一项设置为"100%" 就可以了!


发表于 2013-9-2 23:25:38 | 显示全部楼层
顶起
发表于 2013-9-3 13:44:58 | 显示全部楼层
good
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表