Make column header text selectable?

Make column header text selectable?

ninja_skeeballninja_skeeball Posts: 6Questions: 0Answers: 0
edited April 2013 in DataTables 1.9
Hi.

What code would be needed to properly allow text selection on datatable column headers? We want to keep the sort function enabled and allow for text selection on the column name.

Replies

  • ninja_skeeballninja_skeeball Posts: 6Questions: 0Answers: 0
    Impossibru!
  • ninja_skeeballninja_skeeball Posts: 6Questions: 0Answers: 0
    *bump*

    Any way to make column names hi-lightable so you can use copy and paste on the column names?
  • ninja_skeeballninja_skeeball Posts: 6Questions: 0Answers: 0
    *bump*

    Any help, please?
  • xmikewxmikew Posts: 3Questions: 0Answers: 0
    Is this a browser issue? I have sorting enabled on the header and can copy and paste in firefox.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    Link to a test page shown the problem please: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read

    Like xmikew, I can select and copy header text in DataTables tables.

    Allan
  • ninja_skeeballninja_skeeball Posts: 6Questions: 0Answers: 0
    Certainly, and thanks.

    http://www.datatables.net/release-datatables/examples/basic_init/zero_config.html

    This is an example.

    Using Chrome Version 26.0.1410.63

    I place the mouse cursor to the left of any column name, eg: "Browser", I then press the mouse button, move over the word browser, and release the mouse button.

    Expected effect:
    "Browser" is highlighted.

    Actual effect:
    Table is resorted by browser.
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    I'm not sure why it was working for me before, and not now - but I suspect it is this event handler that is causing the problem for you: https://github.com/DataTables/DataTables/blob/master/media/js/jquery.dataTables.js#L4780 . I'd suggest just removing it.

    Allan
  • ninja_skeeballninja_skeeball Posts: 6Questions: 0Answers: 0
    That's perfect, Allan.

    Thanks a ton! You da man! =D
This discussion has been closed.