Weird column count issue

Weird column count issue

LightESLightES Posts: 3Questions: 1Answers: 0
edited June 25 in Free community support

Link to test case: Internal system so I can't really give you a usable link.

===========================================

Debugger code (debug.datatables.net): I got a 403 error when I hit the button so I pasted it here below.

===========================================

Error messages shown: No errors are shown - simply the tables rows are not displayed as if there are no rows (the data source has data).

===========================================

Description of problem: From some reason I fail to add another column.
I currently have 7 columns and I wish to add another one, but once I do it fails to display the data.
In the code pasted below you can see a column is commented - as long as it is commented the data is displayed.
Once I uncomment the column no data is being displayed and I get a message of no data to display.

I know it is a weird issue but I really hope you have an idea on this.

mazemate_crm_engine.serviceCallsDataTable = jQuery('div.service-calls-list-container table').DataTable( {
    data: dataForTable,
    paging: false,
    fixedHeader: true,
    scrollCollapse: true,
    scrollY: '50vh',
    columns: [
        {
            className: 'dt-control',
            orderable: false,
            data: null,
            defaultContent: '',
        },
        { data: 'created_at', title: 'date', className: 'dt-header-style', type: 'date' },
        { data: 'service_id', title: 'service id', className: 'dt-header-style', type: 'integer' },
        { data: 'area', title: 'area', className: 'dt-header-style', type: 'string' },
        { data: 'type', title: 'type', className: 'dt-header-style', type: 'string' },
        { data: 'descriptionShort', title: 'description', className: 'dt-header-style', type: 'string', width: '140px' },
        // { data: 'closed', title: 'date closed', className: 'dt-header-style', type: 'date' },
        { data: 'status', title: 'status', className: 'dt-header-style', type: 'string', sorting: false, visible: false },
    ],
    order: {
        name: 'created_at',
        dir: 'desc'
    }
} );

function format(d) {
    return (
        '<div class="extra-information">' +
        '<div class="extra-information-piece"><span>service_id:</span><span>' + d.service_id + '</span></div>' +
        '<div class="extra-information-piece"><span>created_at:</span><span>' + d.created_at + '</span></div>' +
        '<div class="extra-information-piece"><span>contact:</span><span>' + d.contact + '</span></div>' +
        '<div class="extra-information-piece"><span>owner:</span><span>' + d.owner + '</span></div>' +
        '<div class="extra-information-piece"><span>area:</span><span>' + d.area + '</span></div>' +
        '<div class="extra-information-piece"><span>type:</span><span>' + d.type + '</span></div>' +
        '<div class="extra-information-piece"><span>request:</span><span>' + d.request + '</span></div>' +
        '<div class="extra-information-piece"><span>descriptionFull:</span><span>' + d.descriptionFull + '</span></div>' +
        '<div class="extra-information-piece"><span>status:</span><span>' + d.status + '</span></div>' +
        '<div class="extra-information-piece"><span>closed:</span><span>' + (d.closed == null ? '' : d.closed) + '</span></div>' +
        '</div>'
    );
}

mazemate_crm_engine.serviceCallsDataTable.on('click', 'td.dt-control', function (e) {
    let tr = e.target.closest('tr');
    let row = mazemate_crm_engine.serviceCallsDataTable.row(tr);
 
    if (row.child.isShown()) {
        // This row is already open - close it
        row.child.hide();
    }
    else {
        // Open this row
        row.child(format(row.data())).show();
    }
});

===========================================

Table information
Summary information about the DataTables on this page.
Information about 1 table available

DataTables_Table_0

Data source: Ajax
Processing mode: Client-side
Draws: 2
Columns: 8
Rows - total: 25
Rows - after search: 0
Display start: 0
Display length: 10
Version check
Check to see if your page is running the latest DataTables software.
LibraryInfoInstalledLatest
DataTablesUp to date2.3.22.3.2
AutoFill-2.7.0
Buttons-3.2.3
ColReorder-2.1.1
ColumnControl-1.0.6
Editor-2.4.2
FixedColumns-5.0.4
FixedHeader-4.0.3
KeyTable-2.12.1
Responsive-3.0.4
RowGroup-1.5.1
RowReorder-1.5.0
Scroller-2.4.3
SearchBuilder-1.8.2
SearchPanes-2.3.3
Select-3.0.1
Check for common issues
Run automated tests to check for common and previously reported issues.
16 tests complete. No failures or warnings found!

If you are having problems with your DataTables, please upload a data profile using the Upload option below, and post a support request in DataTables forums, with a link to a page showing the issue so we can help to debug and investigate the issue.
Upload configuration data
Upload your table's configuration and data to allow for further analysis.
It can often greatly assist in debugging a table if we can see the configuration and data in the table. This feature of the debugger will read your local DataTables configuration and upload it to debug.datatables.net for inspection.

Important: The data uploaded to the server can only be viewed by SpryMedia employees will be automatically deleted after two weeks. The data will never be sold or otherwise published. It is used for debugging any issues you are experiencing with DataTables only.

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

  • allanallan Posts: 64,631Questions: 1Answers: 10,686 Site admin

    Can you use https://live.datatables.net or JSFiddle (or any other similar service) to create a test case showing the issue please?

    Allan

  • LightESLightES Posts: 3Questions: 1Answers: 0

    Live DataTables Net link
    It doesn't reproduce there.
    And it doesn't matter which column I comment in my site,
    as long as it remains on 7 the rows are displayed
    and once I uncomment the 8th column the rows like don't exist.

  • LightESLightES Posts: 3Questions: 1Answers: 0

    So sorry!!!!!!!
    I continued to play with the columns, I removed the last column "status" and it happened. I expected to see all rows.
    This is when I remembered the search button to filter the table - it was on column 6.
    So the filter simply gave no column to show.
    Once I change the filter to work on column 7 it started working normal.
    Thank you.

  • kthorngrenkthorngren Posts: 22,070Questions: 26Answers: 5,086

    Are you initializing a Datatable then on the same page initializing it again with a different column count?

    The HTML table in the test case is very simplistic. Is that how the HTML table is defined on your page?

    Kevin

  • kthorngrenkthorngren Posts: 22,070Questions: 26Answers: 5,086

    Looks like we cross posted :smile:

    Kevin

Sign In or Register to comment.