JqGrid tooltip for a column

别来无恙 提交于 2019-12-05 21:56:00

You can use

cellattr: function () { return ' title="the tooltip text"'; }

I use such kind of tooltips personally on every column having formatter: "checkbox". It is very practical if one have many columns with chechboxes and look at some row in the middle of the grid. In the case it's frequently difficult to determine in which column is the checkbox. In the case the above tooltips are very helpful.

Like you see the cellattr is a function and which has some optional parameters: rowId, cellValue, rawObject etc (see the documentation). It allows you to create really flexible tooltip texts.

One more remark. The advantage of cellattr compared to the custom formatters is that you can continue to use predefined formatters and set only custom attributes like title, class and so on. So you can set custom attribute on the columns having select, date, integer, checkbox and so on formatter.

To use this functionality with the asp.net library of jqGrid, add this to your column. I can't find this documented well anywhere else online...

<Formatter>
    <trirand:CustomFormatter SetAttributesFunction="clientSideFunctionName" />
</Formatter>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!