我想点击按钮删除,我会得到CustomerID
并发送给行动。执行功能删除。
<display:table name="sessionScope.CustomerForm.customers" id="row"
requestURI="/Customer.do" pagesize="15" style="text-align:center"
excludedParams="_chk" clearStatus="true">
<display:column title="checkkbox">
<input type="checkbox" onclick="selectCheckbox();" id="checkBox" />
</display:column>
<display:column style="width:500px" property="customerID"
title="Customer ID" sortable="true" paramId="customerID"
href="Edit.do">
</display:column>
<display:column style="width:300px" property="customerName"
title="Customer Name" sortable="true" />
<display:column style="width:300px" property="sex" title="Sex"
sortable="true" />
<display:column style="width:300px" property="birthday"
title="Birthday" sortable="true" />
<display:column style="width:300px" property="email" title="Email"
sortable="true" />
<display:column style="width:300px" property="address"
title="Address" sortable="true" />
</display:table>
</div>
<br>
<div>
<html:button styleClass="submit" property="Add new" value="Add New"></html:button>
<html:button styleClass="submit" property="Delete" value="Delete" ></html:button>
</div>
</html:form>
答案 0 :(得分:0)
将customerID参数传递给js函数,如下所示:
<display:column title="checkkbox">
<input type="checkbox" onclick="selectCheckbox(<bean:write value="customerID" />);" id="checkBox" />
</display:column>
或
将this
传递给你的js函数,然后使用js或jQuery导航你的html代码
例如,你可以使用这样的东西:
function selectCheckbox(element){
var customerID = $(element).parent().children("td")[1].html();
// do your stuff!
}