Easyui Masking Implementation Method

Source: Internet
Author: User

Project in the submission of AJAX requests, the background processing data time is a bit long, need a mask, just find a realization: There are two ways, personal preferred the second kind

The first type:

$ ("#saveMaterial"). Click (function() { $.messager.progress ({title: ' Please later ', msg: ' Data saved in ... '}; varurl = prefix_location+ "/cpv3materialctrl/savematerial"; varparams = {                "Quotationid": Quotationid,"Universities": Quotationmaterial.universities,"Universitychange": Quotationmaterial.universitychange}; $.post (Url,{params:json.stringify (params)},function(data) {if(Data &&data.flag) {quotationmaterial.universities= []; Opener. Costpage.initandrefresh (true); $.messager.progress ( ' close ');//close after processing is complete$.messager.alert ("Action Tip", Data.message, "info",function() {window.close ();                }); } Else{$.messager.progress (' Close '); $.messager.alert ("Action Tip", Data.message, "error"); }            },"JSON"); });

Effect

The second type:

$.messager.confirm ("Prompt", "Are you sure you want to build the version?") ",function(action) {if(Action) { $ ( "<div id=\" procss\ "class=\" Datagrid-mask\ "></div>"). CSS ({display: "Block", Width: "100%", height:$ (             window). Height ()}). AppendTo ("body"); $ ("<div id=\" Procssmark\ "class=\" datagrid-mask-msg\ "></div>"). HTML ("Generating quote version ..."). AppendTo ("Body") . CSS ({display: "Block", Left: ($ (document.body). Outerwidth (True)-$)/2,top: ($ (window). Height ()-2});             /*$.messager.progress ({title: ' Please later ', msg: ' Generating quote version ... '});*/$.ajax ({URL:' ${ctx}/cpv3quotationctrl/createversion?projectid= ' +projectid+ ' &quotationid= ' +data[0]. quotation_id, type:"Get", Cache:false, Success:function(back) {if(back.flag) {//$.messager.progress (' close ');                   $ ("#procss"). Remove ();//After processing is finished removing $ ("#procssMark" ). Remove ();//$.messager.alert after processing is complete ("Prompt Message", "Version created successfully!", "info"); $("#personManage"). DataGrid ("Reload")); } Else{alert (back.message); }}, Error:function(back) {CDialog ("Operation failed: Ajax returned exception");    }        }); }    })

Effect

Easyui Matte Implementation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.