Show/Hide row
Show/Hide row
oktav2k3
Posts: 6Questions: 0Answers: 0
Hello,
First off, I know I can use the $.fn.dataTableExt.afnFiltering in order to add filtering to a datatable but that's an issue for me.
Basically I have a table with hundreds of rows and about 10 columns. This is a very dynamic table as it will get updated asynchronously via a websocket connection. I receive one message for each row in the table and based on it's info I update those specific cells with new text and data-attributes. This happens every 30 seconds per row.
Now I'd like to hide some rows based on certain data-attributes that get updated via websockets and the way I found so far would be to push a function to $.fn.dataTableExt.afnFiltering that will filter the table. In order for this to work I would need to redraw the table every time a new message arrives. If I do this I will kill my browser because messages can arrive 10-50 every second.
Another option would be to simply hide the row if needed when a message arrives. If it needs not be hidden, I can just leave it be and save up a lot of system resources but I couldn't find such a function.
Any idea on how could I achieve this? Maybe some hidden datatables call that's not in the docs?
Thank,
Oktav
P.S. When redraw occurs I loose focus on some input fields in a special row that's always visible, making it basically impossible to use.
P.P.S I can't link to any code because of the complex nature of this setup (websockets...)
First off, I know I can use the $.fn.dataTableExt.afnFiltering in order to add filtering to a datatable but that's an issue for me.
Basically I have a table with hundreds of rows and about 10 columns. This is a very dynamic table as it will get updated asynchronously via a websocket connection. I receive one message for each row in the table and based on it's info I update those specific cells with new text and data-attributes. This happens every 30 seconds per row.
Now I'd like to hide some rows based on certain data-attributes that get updated via websockets and the way I found so far would be to push a function to $.fn.dataTableExt.afnFiltering that will filter the table. In order for this to work I would need to redraw the table every time a new message arrives. If I do this I will kill my browser because messages can arrive 10-50 every second.
Another option would be to simply hide the row if needed when a message arrives. If it needs not be hidden, I can just leave it be and save up a lot of system resources but I couldn't find such a function.
Any idea on how could I achieve this? Maybe some hidden datatables call that's not in the docs?
Thank,
Oktav
P.S. When redraw occurs I loose focus on some input fields in a special row that's always visible, making it basically impossible to use.
P.P.S I can't link to any code because of the complex nature of this setup (websockets...)
This discussion has been closed.