1

Guys I am using display tag in my jsp page and I am trying to use a format option in display column tag but it's not working, How can I format column tag?. For more info please check out the code below. Appreciated for any help.

<div>
<display:table name="displayStudent" id="displayStudent" requestURI="">
<display:column property="name" title="name" format="nameFormatter()"/> //using format option here 


</display:table>
</div>

//this is a format function 
function nameFormatter(rowid, cellValue, colModel, rowData){
    if(cellValue="hen" || cellValue="den"){
      return "style=color:red";
    }

}

//I used this but I am getting red color in all vaues of a column, Ijust need red color in column with value 'hen' and 'den'
<c:choose>
<c:when test="${name=='hen' || name='den'}">
<display:column property="name" title="name" style="color:red" format="nameFormatter()"/> 
</c:when>
<c:otherwise>
<display:column property="name" title="name" format="nameFormatter()"/> 

</c:otherwise>

</c:choose>
user10806781
  • 41
  • 10

0 Answers0