Select All Button

Select All Button

oneillgoneillg Posts: 33Questions: 9Answers: 0

Hi,

I have a table with select buttons, modeled after the example here. https://editor.datatables.net/examples/inline-editing/simple

In the example there is a checkbox in the header row that doesn't do anything. I have several questions based on this.

  1. How do I get it to implement Select All/None?
  2. How do I suppress it entirely?
  3. In my case I get the sorting arrows grayed out even though I've said it is unsortable. How do I get rid of those?

My example is here: http://datatables.digitalaccelerant.com.

Thank you.

-Gabe

This question has accepted answers - jump to:

Answers

  • kthorngrenkthorngren Posts: 21,572Questions: 26Answers: 4,997

    The select checkbox in the header is a bug in the latest select version. You can use the nightly version to eliminate it.

    You have duplicate sorting arrows; one from Datatables and the other from Bootstrap. The best option is to use the Datatables Bootstrap includes from the download builder.

    I'm not sure why the fist column is initially getting the sort icon. Maybe sorting out the CSS files form the download builder will help.

    Kevin

  • ApezdrApezdr Posts: 43Questions: 4Answers: 5
    edited March 2017 Answer ✓

    The third question I think you've done the right thing with the column orderable = false, you just need to set a default sort column to fix the issue I believe.

    Add this before your columns:{} definition.

    order: [[2, 'desc']],
    columns: [
                        {
                            data: null,
                            defaultContent: '',
                            className: 'select-checkbox',
                            orderable: false
                        },
                        etc...
                   ]
    
  • oneillgoneillg Posts: 33Questions: 9Answers: 0

    Apezdr,
    Yer awesome! The default sorting of the last name column got rid of the sort glyphs. Thank you!!

    kthorngren,
    Thanks for your feedback. I got both the nightly versions of the datatables css and js files and the checkbox in the header is still there. Any thoughts? Thanks!

  • kthorngrenkthorngren Posts: 21,572Questions: 26Answers: 4,997
    Answer ✓

    I got both the nightly versions of the datatables css and js files and the checkbox in the header is still there. Any thoughts?

    Did you get the nightly version of the select extension? That is the one with the bug.

    Kevin

  • oneillgoneillg Posts: 33Questions: 9Answers: 0

    Thanks Kevin. Yes that did work. I really appreciate both your efforts. :smile:

    -Gabe

This discussion has been closed.