Question

Output:

enter image description here

In Fresh column has 0.0,0.0,0.0 is a 3 column Output i will concat from Servlet to jsp. In Grid table I want to show row by row..

Fresh 
__________
0.0
0.0
0.0
___________
0.0
0.0
0.0
___________

Like That...

How to do it?

My Jsp Page:

<%@ 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>
Was it helpful?

Solution

Basing on what I've discovered in this answer, you could easily use a custom Formatter:

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

<sjg:gridColumn name = "fresh" 
                  id = "fresh" 
               title = "Fresh" 
           formatter = "freshFormatter" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top