The link produced by a custom formatter only shows its text when moused over
I am using jqgrid grails plugin.
Column model for the column is:
{name:'id', index:'id', editable:true, align:'center', formatter:jobListLinkFormatter}
Custom formatter is:
function jobListLinkFormatter(cellvalue, options, rowObject){
var url = "${createLink(action:'jobListJSON')}" +"/"+cellvalue;
var link ="<a href='" + url + "'"+">my link</a>";
return link;
};
The link is produced correctly, however the text 'my link' only shows when moused over. What is the cause of this problem?
Add generate html: The text for the link only shows when mouse over on the row and 'ui-state-hover' is applied
<table id="configGrid" class="jqTable ui-jqgrid-btable" cellspacing="0" cellpadding="0" border="0" role="grid" aria-multiselectable="false" aria-labelledby="gbox_configGrid" style="width: 1178px; ">
<tbody>
<tr class="jqgfirstrow" role="row" style="height:auto">
<td role="gridcell" style="height:0px;width:1178px;"></td>
</tr>
<tr id="4" role="row" class="ui-widget-content jqgrow ui-row-ltr">
<td role="gridcell" style="text-align:center;" title="my link" aria-describedby="configGrid_id">
<a href="/icm.server/configuration/jobListJSON/5">my link</a>
</td>
</tr>
</tbody&开发者_C百科gt;
</table>
try adding in your link
function jobListLinkFormatter(cellvalue, options, rowObject){
var url = "${createLink(action:'jobListJSON')}" +"/"+cellvalue;
var link ="<a href='" + url + "'"+" style='font-color:red' >my link</a>";
return link;
};
or class="ui-state-error-text"
if this will work that means that you have problems with css so in firebug inspect your link and see what styles are applied to this link and your font color is the same as background or font size is tiny or something like that.
精彩评论