adding/updating data to sorted table, datatable responsive extension css question
adding/updating data to sorted table, datatable responsive extension css question
http://jsfiddle.net/hfmc328f/8/
First question:
I have table with 4 columns(A,B,C,D). "A" is static number and table must be always orderd by it. "B" is dynamic and I have to update it on different events. "C" column is calculated by A * B and when B value changes I have to update also C and D. D column is sum of all C values till this row.
When event for update table occurs I receive new A and B values and there are two possibilities: If A value exists in table I have to update row with A value (add B value to existing B value of row and update C and D colums of table). If value A doesnt exist in table I have to add it to table on corrent index so table must remain sorted and then calculate(update) C and D columns.
I tried to do math on beforeDraw event but I have issues because api.data() object wasnt sorted. Also I tried to sort it manually but it doesnt work. If I add row with table.row.add(object).draw() and then try to update other rows I cant because I have again issues with object order.
Second question:
Why doesnt table resize when I maximaze browser window? I am using responsive extension and when I load page it works but when I maximaze browser to full screen tabel remains the same.
Third question:
Why do table get out of container div?