1、将category.jsp中改一下
<div class="formInput">
<span>所属父类:</span>
<select name = "parentId" id = "parentId">
<option value="0">顶级分类 </option>
<c:forEach items="${catList }" var="row">
<option value="${row.id }">${row.catName } </option>
</c:forEach>
</select>
<!-- <input type="text" name="parentId" id="parentId" /> -->
</div>
再添一个关闭按钮
<input class="formButton" type="button" value="关闭" onClick="closeDiv()" />
<script type="text/javascript">
function closeDiv(){
$(".box").hide();
}
</script>
设计一下按钮的样式,同时将按钮的class改:btn2 formButton,两个都要改
<style type="text/css">
.btn2{
width:40% !important;
margin-left:10px;
}
</style>
3、创建一个dic表
create table dic(
id int(11) not null auto_increment comment 'ID',
dic_name VARCHAR(100) DEFAULT null comment '字典名称',
dic_code VARCHAR(100) DEFAULT null comment '字典编码,不能重复',
item_code VARCHAR(100) DEFAULT null comment '字典项值,同一个字典编码中值不重复',
item_desc VARCHAR(100) DEFAULT null comment '字典项描述,同一个字典编码中值不重复',
dic_remark VARCHAR(100) DEFAULT null comment '备注',
PRIMARY key(id)
)DEFAULT CHARSET=utf8;
将CodeBuilder.java中进行修改
String modelClass = "DicCondition";
String model = "Dic";//Menu Controller Menu Service
String modelName = "dic";
运行 http:// localhost:8080/shop/dic/list.do