JSP fetching values from the table several practices

Source: Internet
Author: User

The first is the JS with the parameter popup window

<%@ page language= "java" contenttype= "text/html; Charset=utf-8 "
pageencoding= "UTF-8"%>
<%@ taglib prefix= "s" uri= "/struts-tags"%>
<! DOCTYPE html>
<title>${bussi.bussinessName}</title>
<s:include value= "/temp/head.jsp" ></s:include>
<script type= "Text/javascript" >
var tableoptions = {
Data URL
URL: ' <s:url action= ' Ecmodellistjson ' namespace= '/ecplatform/system ' ></s:url> ',
Sortname: ' Order_num ',
SortOrder: ' Desc ',
List Selector
Selector: ' #grid ',
Title: ' ${bussi.bussinessname} ',
New Window
Newurl: ' <s:url action= ' ecmodeldetail ' ></s:url> ',
View window
Viewurl: ' <s:url action= ' ecmodeldetail ' ></s:url> ',
Export URL
Exporturl: ' <s:url action= ' ecmodellistexcel ' ></s:url> ',
keyID Field
Keyidfield: ' model_id ',
Workflowsidebar:false
Showfooter:true
};

var dg = new Defdatagrid (tableoptions);

$ (function () {
$ (' #setBtn '). Click (function () {
var url = ' <s:url action= ' ecmodelparamdetail ' ></s:url> ';
var row = $ (' #grid '). DataGrid (' getselected ');
url = Concaturl (url,{key:row.model_id});
if (!row)
Return
Popdialog (' Paramset ', {
Title: "Setting Parameters",
width:800,
height:400
},url, function () {
$ ("#grid"). DataGrid ("Reload");
});
});
$ (' #editBtn '). Hide ();
});
</script>
<body class= "Easyui-layout" style= "Visibility:hidden" >
<div data-options= "region: ' Center ', border:false"
Style= "Overflow:hidden;" >
<table id= "Grid" >
<thead>
<tr>
<th width= "100"
data-options= "halign: ' Center ', field: ' Model_name ', sortable:true" >
Model name
</th>
<th width= "100"
data-options= "halign: ' Center ', field: ' Is_use ', sortable:true,formatter:formattery" >
Whether to use
</th>
<th width= "100"
data-options= "halign: ' Center ', field: ' Order_num ', sortable:true" >
Sort
</th>
<th width= "100"
data-options= "halign: ' Center ', field: ' Remark ', sortable:true" >
Note
</th>
</tr>
</thead>
</table>
</div>
<!--Toolbars--
<div id= "TB" >
<div>

<s:if test= "#opt. SET ">
<a href= "#" class= "Easyui-linkbutton" iconcls= "Eicon-edit" plain= "true" id= "setbtn" > Settings </a>
</s:if>

</div>


</div>
</body>

Single photo

Js
function initform () {
Loadformdata (' #ff ', en, ' en. '); /Put it to the last
if (en && en.modelimg) {
Imgurl = '/upload/' + en.modelimg;
$ (' #modelImg '). attr (' src ', imgurl);
}

Ui
<div class= "FormInput" >
<div class= "Forminputlabel" > Model pictures:</div>
<div class= "Forminputcontent" >


<div style= "width:250px;" >
<span id= "Size" > Recommended size 332*332 (w * h), 30K in size </span>
<a href= "#" class= "Easyui-linkbutton"
iconcls= "Eicon-upload" title= "select" id= "uploadbtn" > Upload </a>
</div>
<script type= "Text/javascript" >
TOFILEBTN (' #uploadBtn ', function (data) {
data.modelimg = Data.pathname + data.filename;
en.modelimg = data.modelimg;
Loadformdata (' #ff ', data, ' en. ');
$ (' #modelImg '). attr (' src ', ' <s:url value= '/upload/' ></s:url> ' + data.modelimg);
}, [' PNG ', ' jpeg ', ' jpg ']);
</script>
</div>
</div>

Multiple photos

JSP fetching values from the table several practices

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.