Invalidate a single column only

Invalidate a single column only

guillochonguillochon Posts: 56Questions: 19Answers: 0
edited January 2017 in Free community support

I can't quite get the syntax here correct, I'm trying:

table.cells(null, altitudeColumn).invalidate();

...but this isn't invalidating that column's values. A table.rows().invalidate() invalidates everything, but it's expensive. I tried also table.column( 'altitude' ).cells().invalidate() as well, but this is even slower than table.rows().invalidate(), which doesn't make sense given that we're only invalidating one row, rather than the whole table!

What's wrong with my current call?

This question has an accepted answers - jump to answer

Answers

  • guillochonguillochon Posts: 56Questions: 19Answers: 0

    Any suggestion of what to try here? A full table invalidate takes a long time, and I'd like to avoid it.

  • guillochonguillochon Posts: 56Questions: 19Answers: 0

    Also, I'd like to mention that while this forum thread states there is a columns().invalidate() method, that is not the case in the current version of DataTables. Is this just an oversight?

  • allanallan Posts: 63,839Questions: 1Answers: 10,518 Site admin
    Answer ✓

    table.column( 'altitude' ).cells().invalidate()

    is actually the same as table.cells().invalidate(). The selectors are not additive.

    table.cells(null, altitudeColumn).invalidate() should work. If it doesn't can you post a link to a test case showing the issue please.

    Also, I'd like to mention that while this forum thread states there is a columns().invalidate() method

    That thread is wrong, sorry. i'll correct it.

    Allan

This discussion has been closed.