Mouseover icon when table row clickable

Mouseover icon when table row clickable

Cog1Cog1 Posts: 7Questions: 0Answers: 0
edited July 2012 in General
Hi there

This might be a silly question, or not truly datatables related. However...

At the moment, I have clickable table rows that open a new page. I'd like the fact they are clickable to be more obvious - by changing the mouse icon to a hand. I'd also like to stop the cursor from changing to the text entry bar when hovering over text within a row.

Here's my current script:

[code]
$(window).load(function() {
/* Init DataTables */
$('#table-example').dataTable({
// "sScrollY": "400px", // set max height before scrolling
// "bPaginate": false, // stop table from paginating
// "bSort": false // stop table from sorting and offering sort options
// "bInfo": false, // hide summary
// "bFilter": false // hide search/filter box
// "sPaginationType": "full_numbers" // add screen numbering

"aaSorting": [[ 1, "asc" ]], /* make the Title column default sort asc */
"aoColumns": [
/* Ref */ { "bVisible": true }, /* not hiding the ref column */
/* Title */ null,
/* Item */ null,
/* Count */ null,
/* Bookings */ null,
/* Enabled */ null
]

});

/* Add events - TR onClick */
$('#table-example tbody tr').live('click', function () {
var nTds = $('td', this);
var propID = $(nTds[0]).text();

sTitle = 'PropertyID '+propID;
// alert( sTitle ) /* uncomment for debug */

void(
open
('edit.php?propertyid='+propID+'&source=search','_self','resizable,location,menubar,toolbar,scrollbars,status')
)
} );

} );
[/code]

Thanks in advance!

Replies

  • allanallan Posts: 63,542Questions: 1Answers: 10,476 Site admin
    > I'd like the fact they are clickable to be more obvious - by changing the mouse icon to a hand

    [code]
    tr {
    cursor: pointer;
    }
    [/code]

    in your CSS :-)

    Allan
  • Cog1Cog1 Posts: 7Questions: 0Answers: 0
    I was so focussed on the datatables code I forgot the obvious!!!

    Thank you.
This discussion has been closed.