Responsive: Refresh/Update column classes 'all', 'none' & 'never'

Responsive: Refresh/Update column classes 'all', 'none' & 'never'

JamaurJamaur Posts: 87Questions: 10Answers: 0

Is there anyway to update column classes at realtime and make responsive act accordingly? (Ex: Change column class from all to none, none to never, ecc...)
responsive.recalc() doesn't seem to do that.

Replies

  • JamaurJamaur Posts: 87Questions: 10Answers: 0

    ...

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    Currently no. There is no option for that in Responsive.

    Allan

  • JamaurJamaur Posts: 87Questions: 10Answers: 0

    Thanks for the reply.

    This would be interesting to have as an api method :D

  • JamaurJamaur Posts: 87Questions: 10Answers: 0

    I created a custom responsive plugin method, named updateClassLogic.
    Just call this function after switching classes ('all', 'none', 'never' or '') and responsive will act accordingly.

    Api.register('responsive.updateClassLogic()', function (rowIdx, intParse, virtual) {
        this.iterator('table', function (ctx) {
            if (ctx._responsive) {
                ctx._responsive._classLogic();
                ctx._responsive._resizeAuto();
                ctx._responsive._resize();
            }
        });
    });
    

    Usage:

    $('#example').DataTable().responsive.updateClassLogic()
    
  • JamaurJamaur Posts: 87Questions: 10Answers: 0

    Has the never class bug been fixed? Which was mentioned in this thread http://datatables.net/forums/discussion/23427

  • allanallan Posts: 63,516Questions: 1Answers: 10,472 Site admin

    I've not had time to work on it yet, so no - it is still on my to-do list.

    Allan

  • JamaurJamaur Posts: 87Questions: 10Answers: 0

    Thanks or replying. It's ok there's no hurry.

This discussion has been closed.