Show Hide rows in table in loop

Show Hide rows in table in loop

bagsiurbagsiur Posts: 1Questions: 1Answers: 0

I have fallowing pseudocode loop:

    my_table.rows().every( function ( rowIdx, tableLoop, rowLoop ) {
        var data = this.data();
        var row = this;

        if(my_special_condition == true){
            row.hide();
        } else {
            row.show();
        }

    });

Is important for me to show and hide rows in iterating loop. How can I do this ?

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @bagsiur ,

    You can't hide and show rows like that. They can be removed with row().remove() and then added back in with row.add(). If you want the ability for them to be hidden/shown, you'll have to create a custom filter to remove the records.

    Cheers,

    Colin

This discussion has been closed.