分享

dialog对话框

 走墨 2014-09-11
打开的时候

                        var distributeRole1;
function openRoleType(id){
//top.distributeRoleType.close('distributeRoleType')parent.lhgdialog.list['distributeRoleType']
distributeRole1=$.dialog({id:'distributeRoleType1', 
   title:'角色分配',
   background: '#FFF', /* 背景色 默认的遮罩背景色为:#DCE2F1浅蓝护眼色 */ 
   opacity: 0.5,       /* 透明度 */ 
   content: 'url:${root}/base/BaseOperateRole/show.jspx?id='+id+'&date='+new Date().getTime(), 
   max: false, 
   min: false,
   drag: false, 
   resize: false,
   width: 450, 
   height:180
});
}



关闭的时候

function saveRoleType(){
var api = frameElement.api, W = api.opener;
var flag=false;//选中时候为checked
//这里写一个for循环算了
var check=document.getElementsByName("roletype");
for(var i=0;i<check.length;i++){
if(check[i].checked==true){
flag=true;
break;
}
}
if(flag ==false){
W.$.dialog.tips('请选择要分配的角色!',1,'alert.gif',function(){});
return false;
}else{
$.ajax({
type:'post',
url:'${root}/base/BaseOperateUserRole/save.jspx?id=${id}&date='+new Date().getTime(),
data:$("#frm").serialize(),
success:function(){
var api = frameElement.api, W = api.opener;
   parent.mainFrame.i51.document.location.href="${root}/base/BaseUser/operateList.jspx";
W.lhgdialog.list['distributeRoleType1'].close();
}
});
}
//document.location.href="${root}/";
}


确认对话框
$.dialog.confirm('确定要对资源更新索引么?', function(){
               //frm.submit();
            $("#gxsy").replaceWith(textstr);
            var params=$('#frm').serialize();
           
            $.ajax({
                type:'post',
                data:params,   //要传递的数据;就是上面序列化的值  
                url:'${root}/resource/SdResResource/updateIndexByGroup.jspx?&date=' +new Date().getTime(),
                success:function(){

                          top.mainFrame.i91.document.location.reload();
                    }
         });
            }, function(){
            });

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多