zaratul
|
Posted: 05/16/2008, 2:19 AM |
|
Hi All
I hope somebody can help me. I need a way to hide columns in a table
dynamicaly. The user must click on checkboxes that will determine which
colums must be displayed
If anybody knows how to do this please help
Regards and thanks in advance
|
|
|
TheunisP
Posts: 342
|
Posted: 05/16/2008, 2:42 AM |
|
z, ok to do this you have to keep in mind how tables work e.g. their is columns in rows ok - so while it is easy to hide a row, columns on the other hand is spanning rows so you can't just encapsulate it and be done - but here is my suggestion
put you hidable columsn into panels - you can then switch of the panel e.g.
<!--panel start>
<td>
warra warra
</td>
<!--panel end>
remember to do this for the heading as well
now the catch is handle the colspan in the nav td at the bottom - you will have to keep track of how many columns you are actually displaying and adapt the colspan value
I suggest start at the top of you event file
dimension the variable e.g. intNumberOfColumns
intNumberOfColumns=5 ' the default number of columns
you must then deduct the the number of deactivated from that
so that your last rows will display correctly
|
|
|
TheunisP
Posts: 342
|
Posted: 05/16/2008, 2:50 AM |
|
stop! ignore my previous post - you'll need some javascript for this e.g. wrap each and evry columns entry in a DIV then by incrrementing ID do a getelement and set each entries style to None and then reverse it with Inline/Block
|
|
|
TheunisP
Posts: 342
|
Posted: 05/16/2008, 2:54 AM |
|
these guys seem to have a nice solution, with a slightly different approach:
http://www.adp-gmbh.ch/web/js/hiding_column.html
|
|
|