首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

展示结果排序

2012-11-22 
显示结果排序td width9% styletext-align: centercursor:handonclickdoSorting(airlineCode)

显示结果排序


展示结果排序

<td width="9%" style="text-align: center;cursor:hand;"  onclick="doSorting('airlineCode');"><span T:values="@TW航班@@CN航班@@ENAirline@"></span><script type="text/javascript">showIcon("airlineCode");</script></td><td width="17%" style="text-align: center;cursor:hand;" onclick="doSorting('name');"><span T:values="@TW區域名稱(英文)@@CN区域名称(英文)@@ENName(English)@"></span><script type="text/javascript">showIcon("name");</script></td>

?<html:hidden property="sortBy" styleId="sortBy"/>

<html:hidden property="ascOrDesc" styleId="ascOrDesc"/>
function doSorting(sortname){var sortBy = $("sortBy").value;var ascOrDesc  = $("ascOrDesc").value;if(sortBy == sortname){ascOrDesc = (ascOrDesc == "asc" ? "desc" : "asc");}else{ascOrDesc = "asc";}$("sortBy").value = sortname;$("ascOrDesc").value = ascOrDesc;$("doAction").value = "sort";processing();document.forms[0].submit();}function showIcon(sortname){var icon = $("ascOrDesc").value;if($("sortBy").value == sortname){document.write("<img src='../images/"+icon+".gif'></img>");}}
?JAVA:
else if("sort".equalsIgnoreCase(action)){String sortBy = zonesForm.getString("sortBy");String ascOrDesc = zonesForm.getString("ascOrDesc");Order order = null;if("asc".equals(ascOrDesc)){order = Order.asc(sortBy);}else{order = Order.desc(sortBy);}map.put("order", order);}
?org.hibernate.criterion.Order

Order order = (Order) map.get("order");if(order != null){detachedCriteria.addOrder(order);}else{detachedCriteria.addOrder(Order.asc("internalId"));}
?。。。

?

热点排行