标签:style value stand elements led ntc arraylist and 脚本
java代码
List<CodeTableBean> clfsList = StandardCodeTable.getCodeTable("clfs", "");
第一个参数是codetable,第二个是parentcode
List<CodeTableBean> clfs = new ArrayList<CodeTableBean>();
clfs.addAll(clfsList);
super.setRequestAttribute("clfsList", clfs);
JS中
$(document).ready(function(){
var clfs=document.getElementsByName("zx.clfs");
for(var i=0;i<clfs.length;i++){
var c=clfs[i];
<%
String[] clfser=zx.getClfs().split(",");
for(int i=0;i<clfser.length;i++){
out.println("if(c.value==‘"+clfser[i].trim()+"‘) c.checked=true;");
}
%>
}
})
页面代码
<view:qrytr>
<view:qrytd heightshow="true" align="right">处理方式:</view:qrytd>
<view:qrytd>
<s:checkboxlist name="zx.clfs" disabled="true"
list="#request.clfsList" listKey="code" listValue="name"/>
</view:qrytd>
</view:qrytr>
js小脚本解析后台数据
标签:style value stand elements led ntc arraylist and 脚本
原文地址:https://www.cnblogs.com/zhuyeshen/p/10868691.html