Tooltip for struts2 jqGrid column

438 views Asked by At

I have to add a custom tooltip to jqGrid's first column. Exactly as this answer.

loadComplete: function() {
var ids = grid.jqGrid('getDataIDs');
for (var i=0;i<ids.length;i++) {
    var id=ids[i];
    var rowData = grid.jqGrid('getRowData',id);
    $('#'+id,grid[0]).attr('title', rowData.Name + ' (' +
                                    rowData.Category + ', ' +
                                    rowData.Subcategory + ')');
   }
}

But the problem is I am unable to implement it in my grid column

<sjg:gridColumn  name="case_no" index="case_no" title="CaseNo" 
editable="true" sortable="true" formatter="formatLink"/> 

Please suggest me how to add it to the $.subscribe('loadComplete', function(event, data) {} Thanks.

1

There are 1 answers

3
meskobalazs On

Okay, I finally understand your exact problem. I could not try the solution myself, so this is only based on the documentation. First you define your grid, and set a topic:

<sjg:grid
    ...
    onCompleteTopics="loadComplete"
>

Then, you can subscribe:

$.subscribe('loadComplete', function (event, data) {
    ...
});