2014-04-15 16 views
2

輸出:如何在網格模型中用<br>標記jsp中的Servlet?

enter image description here

在新鮮的列具有0.0,0.0,0.0是3列輸出I將從Servlet的Concat的把jsp。 在網格表我想告訴逐行..

Fresh 
__________ 
0.0 
0.0 
0.0 
___________ 
0.0 
0.0 
0.0 
___________ 

這樣...

怎麼辦呢?

我的JSP頁面:

<%@ taglib uri="/struts-tags" prefix="s"%> 
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%> 
<%@taglib prefix="sjg" uri="/struts-jquery-grid-tags"%> 
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" 
    pageEncoding="ISO-8859-1"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<sj:head jqueryui="true" /> 
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> 
<title>Insert title here</title> 
</head> 

<body> 
<font size="4px"> 
    <s:form id="chq_col_cancel" name="chq_col_cancel" theme="simple" 
     action="chq_cancel"> 
     <table width="200px"> 
      <tr align="center"> 
       <td colspan="2">Branch: <s:url id="remoteurl" action="jsonsample" /> 
         <s:select href="%{remoteurl}" id="branch" onchange="view(this)" 
         name="branch" list="{'2','3'}" headerKey="1" 
         headerValue="Select Branch" cssStyle="width:150px; height:22px"/> 
       </td> 
      </tr> 
      <tr> 
       <td colspan="2"> 
       <s:url id="remoteurl" action="finance_yr_fa" /> 
        <sjg:grid id="gridtable" 
        caption="Finance Year Details" 
         dataType="json" 
         loadonce="true" 
         href="%{remoteurl}" 
         gridModel="finYr_grid" 
         cssStyle="font-size:10px" pager="true" 
         rowList="25,50,75" 
         rowNum="0" rownumbers="true" 
         viewrecords="true" 
         width="600" height="500" 
         onSelectRowTopics="goFields" 
         userDataOnFooter="true"> 
         <sjg:gridColumn name="fa_code" id="fa_code" title="fa_code" /> 
         <sjg:gridColumn name="pk" id="pk" title="PK" /> 
         <sjg:gridColumn name="fresh" id="fresh" title="Fresh" /> 
         <sjg:gridColumn name="renewal" id="renewal" title="Renewal" /> 
         <sjg:gridColumn name="total" id="total" title="Total" /> 
         <sjg:gridColumn name="incentive" id="incentive" title="Incentive" /> 
         <sjg:gridColumn name="bpi" id="bpi" title="BPI" /> 
         <sjg:gridColumn name="panno" id="panno" title="panno" /> 
         <sjg:gridColumn name="pr" id="pr" title="PR" /> 
        </sjg:grid></td> 
      </tr> 

     </table> 
</s:form> 
</font> 
</body> 
</html> 
+0

請更清楚 –

+0

我解釋你的預期效果給我的預期結果後我的形象示例.. – sathya

+0

你如何使用'remoteurl'? –

回答

1

此基礎上我在this answer已經發現,你可以很容易地使用自定義格式

<script> 
    function freshFormatter(cellValue, options, rowObject) { 
     return cellValue.split(',').join('<br/>'); 
    } 
</script> 

<sjg:gridColumn name = "fresh" 
        id = "fresh" 
       title = "Fresh" 
      formatter = "freshFormatter" /> 
相關問題