fnSetColumnVis and open rows
fnSetColumnVis and open rows
![ambrauer](https://secure.gravatar.com/avatar/76fe75281c71fee07aa120b1043a94f4/?default=https%3A%2F%2Fvanillicon.com%2F76fe75281c71fee07aa120b1043a94f4_200.png&rating=g&size=120)
I believe I've stumbled across a problem with fnSetColumnVis. Here's the scenario:
1. Initialize a dataTable with one of the columns set to hidden (bVisible: false)
2. Open a row via fnOpen
3. Use fnSetColumnVis to show the initially hidden column
The "open" row does not correctly span the entire number of columns.
The fix appears to be simple - in fnSetColumnVis, change the line (near end of function - where it's looping through all open rows):
[code]oSettings.aoOpenRows[i].nTr.colSpan = _fnVisbleColumns( oSettings );[/code]
to:
[code]oSettings.aoOpenRows[i].nTr.firstChild.colSpan = _fnVisbleColumns( oSettings );[/code]
This way, it's setting the colspan on the td element (which it should be) and not the tr (which I don't believe is valid).
1. Initialize a dataTable with one of the columns set to hidden (bVisible: false)
2. Open a row via fnOpen
3. Use fnSetColumnVis to show the initially hidden column
The "open" row does not correctly span the entire number of columns.
The fix appears to be simple - in fnSetColumnVis, change the line (near end of function - where it's looping through all open rows):
[code]oSettings.aoOpenRows[i].nTr.colSpan = _fnVisbleColumns( oSettings );[/code]
to:
[code]oSettings.aoOpenRows[i].nTr.firstChild.colSpan = _fnVisbleColumns( oSettings );[/code]
This way, it's setting the colspan on the td element (which it should be) and not the tr (which I don't believe is valid).
This discussion has been closed.
Replies
When I have injected / expanded row details and I then proceed to set a columnsVisibility, the injected / expanded rows details colspans are not the correct value - ie colspan=5 should be +/- the amount of columns added / removed.
Is this a defect Allan or is this default behaviour?