Adjusting Columns

Adjusting Columns

menashemenashe Posts: 178Questions: 42Answers: 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

  • allanallan Posts: 62,990Questions: 1Answers: 10,367 Site admin
    Answer ✓

    I presume you are using Bootstrap here? You could try open with a setTimeout( ..., 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

  • menashemenashe Posts: 178Questions: 42Answers: 2

    I was trying setTimeout(..., 200);

    That sometimes worked.

Sign In or Register to comment.