我在应用程序中使用display标记。在那里,我需要根据列标题点击对表内容进行排序。列标题具有链接导航。相反,我需要在点击表格列标题的同时提交表格。我们怎样才能做到这一点。
到目前为止,我的应用程序像这样填满了表格,
<display:table id="data" name="lstEntities"
sort="external" uid="row" htmlId="rowid" class="tborder"
excludedParams="*" style="width:100%"
pagesize="${pageCriteria.recordsPerPage}" partialList="true"
size="${pageCriteria.totalRecords}" export="false"
requestURI="prestigeBrandListMDA.action">
<display:column property="brandId" sortName="brand.brandId"
sortable="true" titleKey="table.title.brandId"
style="width:100px" />
<thead>
<tr>
<th class="sortable">
<a href="prestigeBrandListMDA.action?d-16544-p=1&d-16544-o=2&d-16544-n=1&d-16544-s=brand.brandId">Sales Brand Id</a></th>
相反,我需要下面这样的链接
<thead>
<tr>
<th class="sortable">
<a href="#" onclick="javascript:submitform(prestigeBrandListMDA.action?d-16544-p=1&d-16544-o=2&d-16544-n=1&d-16544-s=brand.brandId)">Sales Brand Id</a></th>
是的,我用Jquery实现了这个功能。谢谢。我用下面的代码实现了它。
$('.sortable').each(function(event){
var obj = $(this).find('a').attr('href');
var urltext = 'javascript:submitform("'+contextPath+'/'+obj+'")';
$(this).find('a').attr('href', urltext);
});
据我所知,使用displaytag无法做到这一点。使用JQuery就绪事件可以动态更改链接。