Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jqgrid change pointer to hand

Tags:

jqgrid

I want to change the pointer to hand when hovering over jqgrid's rows Is there an API for that?

like image 239
strike_noir Avatar asked Apr 20 '10 11:04

strike_noir


3 Answers

This can be done more easily using the classes colModel property as below:

{ name: 'Email', index: 'Email', classes: 'pointer' }

From the wiki:

This option allow to add classes to the column. If more than one class will be used a space should be set. By example classes:'class1 class2' will set a class1 and class2 to every cell on that column. In the grid css there is a predefined class ui-ellipsis which allow to attach ellipsis to a particular row. Also this will work in FireFox too.

like image 134
woggles Avatar answered Sep 17 '22 14:09

woggles


I just add this into my css file

#mygrid .jqgrow{
    cursor:pointer;
}
like image 43
Quincy Avatar answered Sep 20 '22 14:09

Quincy


Use a custom formatter on any cell in the grid. For more info on these, see http://www.trirand.com/jqgridwiki/doku.php?id=wiki:custom_formatter

Here's how I did it. I wanted the first column in my grid to appear like it is a clickable link (but really it triggers a custom jqgrid event, onCellSelect).

Snippet of my grid object:

colModel :[ 
{name:'ticket', index:'IMINDT', width:125, formatter: pointercursor}, 

pointercursor is a function name. The code for it is defined like this:

// Custom formatter for a cell in a jqgrid row. 
function pointercursor(cellvalue, options, rowObject)
{ 
var new_formatted_cellvalue = '<span class="pointer">' + cellvalue + '</span>'; 
return new_formatted_cellvalue; 
} 

My CSS class of "pointer" is:

.pointer { 
cursor: pointer; 
text-decoration: underline;
}    

That's it!

like image 31
fbloggs Avatar answered Sep 16 '22 14:09

fbloggs