How to set background color in grid column of struts-jquery-grid

580 views Asked by At

I am new to Struts and jquery. I want to set the background color in the grid column which is a struts2-jquery api. I have used the effectOptions attribute for this but it doesn't work. I have set the attribute to - sjg:gridColumn effect ="highlight"effectOptions ='color : #aaaaaa' Can any one help me?

1

There are 1 answers

0
madhu pathy On

In SJG u can add color or any javascript using formatter. Find below an example:

     <sjg:gridColumn name="abc" index="abc"
                                        title="TEST COLUMN"
                                        sortable="true" align="left" width="250"
                                        formatter="colorFormatter"/>



function colorFormatter(cellValue, opts, element) {
    if (!cellValue) {
        return '<span class="cellBackground" style="color:#8b8eea;">' + '' + '</span>';
        ;
    }
}