Setting column width and columns vs aoColumns

Setting column width and columns vs aoColumns

brianKbrianK Posts: 9Questions: 5Answers: 0

I wish to remove sorting on the first column and not display the sort arrow above it. Also, I'm getting "ghost row" of the sort columns underneath the header.

Also, should I be using "columns" or aoColumns? Are the quotes optional? I understand the difference of columns and columnDefs, but I don't know where those other names like aoColumns and aoColumnDefs. I think those are "legacy" and I have confused myself by finding examples with those in there. I want to just stick with what is in the latest documentation under http://datatables.net/reference/option/

Also, I would like to specify the column width of my checkbox column. the width does not seem to have an effect. Note that I am scrolling X.

I have DataTables 1.10 (latest stable build)

Here is my definition. I am attempting to create a js filddle of it and will post a link once I get it working.

    $(document).ready(function() {
        var table = $('#example').DataTable( 
        {
            scrollY:        "300px",
            scrollX:        "100%",
            scrollCollapse: true,
            paging:         false,
            autoWidth:      true,       // must specify width in aoColumns if false
            "columns": [                // there must be an entry for every column
                {"width": "30px", "orderable": false},      
                null,
                null,
                null,
                null,
                null,
                null,
                null,
                null,
                null
              ]
        });

        new $.fn.dataTable.FixedColumns( table, 
            {
                "leftColumns": 2        
            });
        } 
    );

Answers

  • brianKbrianK Posts: 9Questions: 5Answers: 0

    Here is a fiddle, but I'm going to need help getting the fiddle going. I put the external js and css includes in the "external resources". Was that right?

    http://jsfiddle.net/briank/UT58L/1/

  • RpiechuraRpiechura Posts: 98Questions: 3Answers: 14

    "I think those are "legacy" and I have confused myself by finding examples with those in there."

    That's correct, those are legacy, the ones you're using the equivalent.

This discussion has been closed.