我在Struts2中使用DisplayTag表库来显示数据库中的记录。我能够在显示标签表中获取表数据。我想通过单击按钮将其中一列(列名称:位置名称)值传递给javascript函数。但是我无法获得该物业的价值。下面是它的代码段。
<display:table class="table-responsive table-striped table" export="false" id="requestListLocationInfo" name="requestListLocationInfo" requestURI="#" pagesize="50" >
<display:column title="Sl No.">
${requestListLocationInfo_rowNum}</display:column>
<display:column property="location_name" title="Location Name" sortable="false" />
<display:column property="status_loc" title="Status" sortable="false" />
<display:column property="created_by" title="Created By" sortable="false" />
<display:column property="date_loc" title="Created Date" sortable="false" />
<display:column title="Modify"><button onclick="getModifyDetails('<s:property value="location_name"/>')">Modify</button></display:column>
</display:table>
和javascript函数如下所示。
function getModifyDetails(location_name){
alert('loc name is'+location_name);
var url = "./getModifyLocDetails.action?location_name="+location_name;
window.open(url,"_blank","directories=no, status=no,width=700, height=500,top=0,left=0");
}
如何获取列值作为js函数的参数?