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