原文:http://blog.sina.com.cn/u/1779423465
动态加载 dojoTree.带复选框
定义div
-->
<div id="CheckBoxTree">
初始化加载父节点(jquery发送post请求)-->
$.post(url,param,finish,"json");
使用struts2(struts.xml) -->
使用spring管理(spring.xml) -->
action (注意注入,还有get,set方法)-->
@SuppressWarnings({"rawtypes","unchecked" })
public String findAllRegion(){
List list = iControl.getAllRegion();
ArrayList sList = (ArrayList)list;
arrayList = sList;
return SUCCESS;
}
接口 -->
List getFirstRegion();
实现 -->
@Transactional(propagation=Propagation.required,readOnly=true)
public List getFirstRegion() {
List jdMap = mngJdMDao.getAllStreet();
return jdMap;
DAO -->
@SuppressWarnings("unchecked")
public List getAllStreet() {
StringBuilder strHql = new StringBuilder();
strHql.append("from MngJdM as jd order by jd.code");
List list = (List) hibernateHelper.getList(
strHql.toString(),null,false,0);
return list;
前端 finish 回调函数(轮到dojo上场了,加载dojo所需要的脚本)-->
function finish(res){
require([
"dojo/ready",