$(document).ready(function(){
$("#add").click(function(){
$("#addto").append(" <input type='checkbox' name='animal'>")
})
})
</script>
</head>
<body>
<div id="addto">
<input type="checkbox" name="animal" id="cat">大象
<input type="checkbox" name="animal" id="dog">老虎
<input type="checkbox" name="animal" id="pig">狮子
</div>
<br/>
<input type="button" name="add" id="add" value="添加">
</body>
jqgrid初始化加上这个方法beforeSelectRow: function (rowid, e) {
var $myGrid = $(this),
i = $.jgrid.getCellIndex($(e.target).closest('td')[0]),
cm = $myGrid.jqGrid('getGridParam', 'colModel')
return (cm[i].name === 'cb')
},
Action里面:private PromotionManageTo promotionManageTo
private List<PromotionManageTo>productClass
get…
set…
SqlMaps里面:
<select resultClass="promotionManage.PromotionManageTo">
……
</select>
JSP里面:
<s:iterator value="productClass" status="productClassLength">
<td>
<input type="checkbox" name="promotionManageTo.productId" value="<fs:property value="productId"/>" <c:if test="${fn:containsIgnoreCase(promotionManageTo.productId, productId)}">checked="checked"</c:if>/>
</td>
</s:iterator>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)