ColReorder.order() automatically redraws the table, is there a way to defer this?

ColReorder.order() automatically redraws the table, is there a way to defer this?

chiloutuschiloutus Posts: 10Questions: 4Answers: 0
edited December 2015 in Free community support

Hi,

I've recently come across a need to defer the redrawing of the table after I change the order. It appears to me in the documentation that this may be possible but I've been struggling to understand how to do this.

Is there a way defer the redraw until I've calculated visibility and the like

Here is a jsfiddle illustrating the automatic redraw.
http://jsfiddle.net/273y3a36/3/

Edit: Updated fiddle

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin
    Answer ✓

    I'm sorry to say that there is no option to defer this. The colReorder.order() method will redraw the table immediately.

    Allan

  • chiloutuschiloutus Posts: 10Questions: 4Answers: 0

    I see, thank you for your response. While I have this still open I have a question regarding the second parameter in column(x).visible(false,false).

    It seems that this hides the columns immediately also however the documentation mentions there is some performance gain on using false rather than the default. Could you comment on redrawCalculations and what it is doing?

  • allanallan Posts: 63,761Questions: 1Answers: 10,510 Site admin
    Answer ✓

    It basically runs columns.adjust() if you don't pass false as the second parameter.

    If you are going to set the visibility of multiple columns, then you are best to do that only once.

    Allan

  • chiloutuschiloutus Posts: 10Questions: 4Answers: 0

    Understood, thanks for your responses, they've been very helpful.

This discussion has been closed.