To see How to open a dialog box with a tag

Source: Internet
Author: User

Perhaps this is a very simple action, you seem to think it's nothing, indeed, after I finished this function, I think it is very simple.

After the popup box is a table, click Modify Connection in the cell, you can pop up the dialog box and be able to pass the data to the front of the page.

Page
<a href="${ctx}/project/editProjectReback/${deal_item.id}" target="dialog" width="600">修改</a>

Attention:
1. Parameter target
2. Width

JS Package
//dialogs$("A[target=dialog]", $p). each ( function(){$( This). Click ( function(event){            var$ This= $( This);vartitle = $ This. attr ("title") || $ This. text ();varoptions = {};varW = $ This. attr ("width");varH = $ This. attr ("Height");if(w) options.width = w;if(h) options.height = h;            Options.title = title; Options.contenttype ="Ajax"; Options.showbutton =Eval($ This. attr ("Showbutton") ||"false"); Options.showcancel =Eval($ This. attr ("Showcancel") ||"false"); Options.showok =Eval($ This. attr ("Showok") ||"false"); Options.type ="Wee"; Options.onopen =Eval($ This. attr ("OnOpen") || function() {}); Options.boxid ="Pop_ajax_dialog";varURL =unescape($ This. attr ("href"). Replacetmbyid ($ (event.target). Parents (". Unitbox:first")); Yunm.debug (URL);if(!url.isfinishedtm ()) {$.showerr ($ This. attr ("Warn") || Yunm.msg ("Alertselectmsg"));return false; } $.weeboxs.open (URL, options);return false; });

Attention:
1. The DWZ code is still borrowed here, by passing the parameters on the a tag to the Weebox popup box.
2. URL, which is used to send internal Weebox to the server via an AJAX request.

When the page is initialized
让以上代码执行以下就好
Weebox Interior
Else if(Self.options.contentType = ="Ajax") {self.ajaxurl = self._content; Self.setcontent (' <div class= ' dialog-loading ' ></div> ');                Self.show (); $.ajax ({type:"POST", Url:self.ajaxurl, Success: function(data) {self._content = data;                        Self.setcontent (self._content);                        Self.onopen (); Self.focus ();if(Self.options.position = =' Center ') {self.setcenterposition (); }}, Error:YUNM.ajaxError})}

Note: Here you use AJAX requests to get to the server data

Jfinal
    @Before(DealsInterceptor.class)    publicvoideditProjectReback() {        ifnull) {            setAttr("deal_item", dealItem);            render("add_reback.jsp");        }    }

Render to the corresponding page, and pass the parameter "Deal_item" to the page.

add_reback.jsp
<textarea class="form-control required" rows="3" placeholder="报内容" name="description">${deal_item.description}</textarea>

Conclusion : This series of processing has a great revelation to my whole project, and then I will make some changes to my original project practice.

Copyright notice: This site blog is qing_gee original article, if you need to quote, reprint, only need to indicate the source and the original link.

To see How to open a dialog box with a tag

Related Article

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.