In jqGrid, is it possible to define a cell’s Title (hover) text while adding row data?
var rowid;
for(var j=0;j<10;j++)
{
rowid = jQuery.Guid.New();
jQuery("#myJqGrid").jqGrid('addRowData',rowid,{Amount:"$"+j+".00",Date:"09/30/2015"});
}
I’d prefer not to not to have to loop over the grid after it has completed, as the RowID and the data that is needed for the custom hover text are more readily available while the row is being added.
Thanks!
If you just need to set custom tooltip on some specific cells in the grid you can use setCell (see here an example). If you want to set tooltips on all cells of some column, but with a custom rule (not just the same tooltip like the cell value), you can better use cellattr. For example you can use
See the demo here which display the following tooltips:
If you have an interest for performance you should not use old
addRowDatamethod which has many disadvantages:formatoptions: {reformatAfterEdit: true}to make the date correct formatted. You will find almost no information about the option in the documentation.dataparameter in combination withgridview: trueparameter (the de demo above) the building of grid contain with respect ofaddRowDatais much slowly. You can see the difference if the number of row is large.cellattrandaddRowDataI found a bug in the jqGrid in the line where two parametersrowidanddataare swapped. I just now posted the bug report. So to usecellattrtogether withaddRowDatayou have to make small modification injquery.jqGrid.src.js.See the demo which use
addRowDatahere. If used modified version ofjquery.jqGrid.src.js(see my bug report for details)