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