Adjusting Columns
Adjusting Columns
menashe
Posts: 196Questions: 43Answers: 2
I am using
itemsEditor.field('items.category_id').dt().columns.adjust();
to adjust the columns in a Nested DataTable (in an Editor).
If I place that line in an
.on(open,...)
nothing happens.
If I use
.on(opened,...)
It works, but you can see the flash on the screen as it adjusts.
Is there any way to have the Editor open with the columns already adjusted?
This question has an accepted answers - jump to answer
Answers
I presume you are using Bootstrap here? You could try
open
with asetTimeout( ..., 0);
perhaps?Part of the issue is that the element (and thus the modal) needs to be on the page to be able to measure the widths. If it isn't there (which is the case in
open
) then you need to wait until it is there - which is why this whole thing is needed in the first place!Allan
I was trying
setTimeout(..., 200);
That sometimes worked.