Clickable Element in Header

Clickable Element in Header

Not_A_TrekieNot_A_Trekie Posts: 2Questions: 0Answers: 0
edited August 2013 in DataTables 1.9
I have a table where I need to place question marks in the header. Ideally these columns would still be sortable. It appears DataTables makes the entire header cell clickable which is causing problems.

Here is how I am trying to initialize DataTable

$(function() {
$('#table').dataTable(
{
"aoColumns": [
{ "bSortable": false, "sTitle": "

Replies

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    And a stopPropagation call to the event handler for your image tag. That should stop the bubbling of the event to the DataTables click event handler.

    Allan
  • Not_A_TrekieNot_A_Trekie Posts: 2Questions: 0Answers: 0
    edited August 2013
    I already have that in the handler. The problem is that DataTables hijacks the entire cell so that anywhere I click in the header will call DataTables.

    For example if my cell looks like this
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    The stopPropagation should stop the event ending up with the DataTables event handler - i.e. you'd should be the final one to execute. I'm not sure why that isn't working. I'll need to try and recreate the issue and take a look, but I'm afraid that might be later in the week as things are a bit busy at the moment.

    Allan
This discussion has been closed.