You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 4, 2023. It is now read-only.
I'm seeing a strange behavior when using a DateTimeColumn which has "visible = false":
When I initially load the datatable, the column is hidden, swichting it to visible using the column chooser, will make it visible, but all cells are empty.
When I reload the table (with the column set to visible), the data is show, this also happens if I just click the "X" next to the filter of the DateTimeColumn.
This does not seem to happen with any other column type.
Maybe there's some workaround to simulate a click on the "X" when switching a DateTimeColumn to visible?
The text was updated successfully, but these errors were encountered:
I found a workaround, added this to the controller: $this->events->set(['column_visibility' => ['template' => 'columnVisibilityEvent.js.twig', 'vars' => ['tableName' => $this->getName()]]]);
and added columnVisibilityEvent.js.twig like this:
function columnVisibilityEvent(e, settings, column, state) {
if (state == true) {
var table = $("#sg-datatables-{{ tableName }}").dataTable();
table.fnDraw(false);
}
}
This redraws the table if a hidden column is switched to "visible". Don't know if it's a proper solution but it seems to work.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I'm seeing a strange behavior when using a DateTimeColumn which has "visible = false":
When I initially load the datatable, the column is hidden, swichting it to visible using the column chooser, will make it visible, but all cells are empty.
When I reload the table (with the column set to visible), the data is show, this also happens if I just click the "X" next to the filter of the DateTimeColumn.
This does not seem to happen with any other column type.
Maybe there's some workaround to simulate a click on the "X" when switching a DateTimeColumn to visible?
The text was updated successfully, but these errors were encountered: