日期:2014-05-16  浏览次数:20333 次

jsp页面控制显示的问题!
我要实现2个功能,第一次显示5条记录,第二次点击按钮后显示50条记录。
数据全部都放在select_customer.question里面,想在页面实现这个功能!
页面代码是:
{for question in select_customer.question}

  <tr onMouseOver="this.style.cursor='hand';this.style.backgroundColor='#DDE4F2'" onmouseout="this.style.cursor='auto';this.style.backgroundColor=''"  onclick="toggle('history_question_content_#{question_index}');" >
    <td align="center">#{question.question_id}&nbsp;|&nbsp;{if question.playURL==null}无录音{else}<a href="#{question.playURL}" target="_blank">播放</a>&nbsp;|&nbsp;<a href="#{question.downloadURL}" target="_blank">下载</a>{/if}</td>
    <td align="center">#{question.agent_rname}</td>
    <td align="center">#{question.type1_name}-#{question.type2_name}</td>
    <td align="center">#{question.speciality_name}</td>
    <td align="center">#{question.phone}</td>
    <td align="center">{if question.direction=="0"}主叫{/if}{if question.direction=="1"}被叫{/if}</td>
    <td align="center">#{question.starttime}</td>
    <td>#{question.content.substring(0,28)}...</td>
  </tr>
    <tr style="display:none"  id="history_question_content_#{question_index}">
    <td align="center" colspan="11">
<table width="100%"cellpadding="3" cellspacing="1" bgcolor="#cccccc">
<tr bgcolor="#FFFFFF">
<td width="15%">游戏名称:&nbsp;<U>#{question.product_name}</U></td>
<td width="20%">服务器 |游戏类型:&nbsp;<U>#{question.server_name}</U></td>
<td width="20%">帐号:&nbsp;<U>#{question.passport}</U></td>
<td width="15%">ID | 泡泡游戏积分:&nbsp;<U>#{question.uid}</U></td>
<td width="15%">等级 | 是否钻石:&nbsp;<U>#{question.level_name}&nbsp;#{question.level2}</U></td>
<td width="15%">昵称:&nbsp;<U>#{question.nickname}</U></td>
</tr>

<tr bgcolor="#FFFFFF">
<td colspan="6">
&lt;textarea readonly ROWS="4" COLS="88"  style="background-color:#FFF; border:1px solid #ccc; width:100%; margin :-2px;"&gt;#{question.content}&lt;/textarea&gt;

</td>
</tr>
</table>

</td>
  </tr>
  <tr>
    <td colspan="8" bgcolor="999999" height="1"></td>
  </tr>
   {forelse}
    <tr bgcolor="white"><td colspan="10">没有相匹配的电话记录</td></tr>
{/for}

数据是一条一条显示的,我在{for question in select_customer.question}下面写了,
for(var i=0;i<50;i++)
if(i>5)
break;
把这条语句放进去,会出错的。把break去掉才行的。
请各位大哥看下啊!谢谢了!