Mouseover icon when table row clickable
Mouseover icon when table row clickable
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!
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!
This discussion has been closed.
Replies
[code]
tr {
cursor: pointer;
}
[/code]
in your CSS :-)
Allan
Thank you.