我在$(document).ready上使用以下行(
$("#stSearchTermsGrid").setCell(2, 2, '', {color:'red'}) ;
Run Code Online (Sandbox Code Playgroud)
但它不起作用.我是以错误的方式写它还是把它放在错误的地方.
我知道这个问题不止一次被问过,这就是我得到第一行的方式.但我仍然无法做到这一点,也不知道问题出在哪里.
如何设置将鼠标悬停在jqGrid行/单元格上时出现的"工具提示"?
目前,工具提示似乎只是单元格内容.
我可以通过在jqgrid自定义格式化程序中执行此操作来更改文本颜色:
function YNFormatter(cellvalue, options, rowObject)
{
var color = (cellvalue == "Y") ? "green" : "red";
var cellHtml = "<span style='color:" + color + "' originalValue='" +
cellvalue + "'>" + cellvalue + "</span>";
return cellHtml;
}
Run Code Online (Sandbox Code Playgroud)
但我想现在改变整个单元格的背景颜色(而不是文本颜色).
这可能吗?
当我设置的GridView到真(GridView控件:真)在我们的jqGrid增加jqGrid的,就像方法的性能afterInsertRow,或者其他类似的方法不会被执行.以下是我的jgGrid的代码:
jQuery("#displaylistGrid").jqGrid({
url: contextRoot + '/StandardProxy/displayListService?userRole='+
userRole+'&userName='+userName+'&userId='+userId+
'&duration='+displayDuration+'&wicNo='+wicNo+
'&displayName='+dlDisplayName+'&displayNameArr='+displayNameArr+
'&pointValue='+pValue+'&locationId='+locId+'&locationCode='+
locCode+'&serviceType=forecast',
datatype: 'json',
colNames: ["CM Name", "Display ", "Loc. Pt.","Max. Ben." ,"Display Name",
"Items w/Fcst", "Units", "Sales $", "Profit $", "GP%", "Units",
"Sales $", "Profit $", "GP%","Hidden","Hidden1","Hidden2",
"Start Date and End Date", "Hidden4"],
colModel: [
{ name: "cm_name", index: "cm_name", sorttype: "text", width: 120,
resizable: true },
{ name: "ds_location", index: "ds_location", sorttype: "text", width: 120,
resizable: true },
{ name: "ds_symbol", index: "ds_symbol", …Run Code Online (Sandbox Code Playgroud) 我使用jqgrid显示服务器中的数据如何显示鼠标悬停工具提示上的数据描述.
这是在jqgrid上显示工具提示的最佳方法?