0

I have my table set up and working correctly using the code below, but whenever I add

columnControl: ['order', ['searchList']]

I get the following error

Cannot read properties of null (reading 'appendChild')

enter image description here

CODE

let mainConfig = {
    ordering: true,
    order: [[1, 'asc'], [2, 'asc']],
    info:     true,
    responsive: true,
    pagingType: "simple_numbers",
    pageLength: 25,
    draw: 1,
    autoWidth: true,
    dom: "<'row'<'#col2.col-xs-12 col-md-6 text-right'fB><'#col1.col-xs-12 col-md-6 text-muted'i>>rt<'bottom'lp><'clear'>",
    buttons: [
        {
            extend: 'csv',
            title: 'CSV File - ' + moment(new Date()).format('YYYY.MM.DD')
        }
    ],
    columnControl: ['order', ['searchList']],
    columns: [
        { data: 'one', className: "text-capitalize", title: 'one' },
        { data: 'two', className: "text-capitalize", title: 'two' },
        { data: 'three', title: 'three' }
    ]
}
 
$('#my-datatable').dataTable(mainConfig).api();

enter image description here

All scripts are loading correctly, so NO replies saying check loading JQ file first, as I have proved my datatable is fully working with my screenshot

1
  • ColumnControl is an extension, and we can't tell whether you embedded the necessary script or not. Your screenshot doesn't really prove anything in that regard. Commented 2 days ago

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.