Datable not showing last column

Datable not showing last column

adpadp Posts: 4Questions: 1Answers: 0

Hello,
I've got a datable which has 15 columns, and is working perfectly fine.

The problem is that I need to add two more columns, but for some reason only one is showing the other is automatically hidden with display: none.

I've checked that the database is retrieving the info OK, and if I remove one of the older columns the 17th column appears.

Is it possible to show more than 16 columns? I've checked the doc and I did not find a limit configuration property or something like that.

Does anyone know why is this happening and how to solve it?

Answers

  • kthorngrenkthorngren Posts: 20,302Questions: 26Answers: 4,769

    Do you have the Responsive Extension enabled on the table?

    Without seeing your code or better a link to your page its hard to say exactly why this is happening. Datatables doesn't limit the number of columns displayed. You have something configured to hide that column.

    Kevin

  • adpadp Posts: 4Questions: 1Answers: 0

    Hello Kevin,

    Thank you for answering.
    I am afraid I cannot share the code as it is owned by a client of my company.

    What I've seen is that the hidding is done on the datatable constructor, apparently to avoid overflowing the viewport, so to say.

    Is there a way to override this?
    The datatable already has horizontal scrolling, so I expected the new columns to be added without any problem...

  • kthorngrenkthorngren Posts: 20,302Questions: 26Answers: 4,769

    What I've seen is that the hidding is done on the datatable constructor, apparently to avoid overflowing the viewport, so to say.

    Are you saying the responsive: true is in the constructor? If so just remove it.

    Kevin

  • adpadp Posts: 4Questions: 1Answers: 0

    I've finally solved it by adding the "all" class to all the columns in the data table:
    <th class="all">...</th>

    That way they are not hidden anymore...

  • adpadp Posts: 4Questions: 1Answers: 0

    Sorry,

    Did not see your last reply.
    No, the responsive: true was not in the constructor.

  • kthorngrenkthorngren Posts: 20,302Questions: 26Answers: 4,769

    Assuming this is the Responsive extension it can be enabled in the following ways:
    https://datatables.net/extensions/responsive/init

    You can remove which ever of these options is being used.

    Kevin

This discussion has been closed.