2

Let me preface this by saying the answer to my question is most likely not the most ideal solution to my problem but it seems to me to be the fastest solution. At a later stage i may revisit this issue and properly solve it.

I have a Datatable with the YADFC plugin which is behaving weirdly.

On refresh of the page, the headers are misaligned wrt the columns as below:

enter image description here

If i resize my window even by the smallest amount, the headers are recalculated and snap in the correct position as below:

enter image description here

Is there any way to programmatically trigger a small window resize event?

Update: Solved using $(window).trigger('resize');

1

1 Answer 1

2

try this

    $(window).resize(function() {
        setTimeout(function() {
            resize();
        })
    })
2
  • Can you indicate what is the difference between your answer and $(window).trigger('resize'); which i ended up using?
    – nluigi
    Feb 2, 2017 at 8:50
  • @nluigi just go through this link you will find the difference between $(window).trigger('resize'); and $(window).resize(function(){}) stackoverflow.com/questions/36777631/… Feb 2, 2017 at 8:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.