jQuery - Table > Hide entire Column, Toggle CSS classes for onClick TD and Checkbox with selected/highlighted Counter -
i looking jquery table multiple functionalities below.
1. onclick on hide column 1 checkboxes @ top, entire column of relevant table should hidden except first column (checkboxes column)
2. onclick of inside tbody tr td except checkbox, should apply "highlighttr" class relevant tr element , onclick of inside tbody tr td checkbox should apply "selecttr" class relevant tr , number should shown in both scenarios.
3. clicking on thead th checkbox should select all checkboxes inside tbody respective class
your appreciated, please me!
html:
<label><input type="checkbox" id="col_1">hide column 1</input></label> <label><input type="checkbox" id="col_2">hide column 2</input></label> <label><input type="checkbox" id="col_3">hide column 3</input></label> <div class="selected-counter">selected: <span>0</span></div> <div class="highlighted-counter">highlighted: <span>0</span></div> <table width="100%" cellpadding="0" cellspacing="0" class="reddytable"> <thead> <tr> <th><input type="checkbox" name="cball" id="cball" /></th> <th>column 1</th> <th>column 2</th> <th>column 3</th> </tr> </thead> <tbody> <tr> <td><input type="checkbox" id="cb1" name="cb1" /></td> <td>lorem ipsum</td> <td>dolar sit</td> <td>amet</td> </tr> <tr> <td><input type="checkbox" id="cb2" name="cb2" /></td> <td>pellentesque</td> <td>semper arcu</td> <td>eget molestie</td> </tr> <tr> <td><input type="checkbox" id="cb3" name="cb3" /></td> <td>ex rutrum et</td> <td>vivamus</td> <td>efficitur</td> </tr> </tbody> </table>
css:
body{font-family:arial;} label{margin-right:15px;} table.reddytable{border:1px solid #ccc;margin-top:20px;border-collapse:collapse;} table.reddytable th{text-align:left;border:1px solid #aaa;padding:5px;background:#ddd;} table.reddytable td{border:1px solid #ccc;padding:5px;} table.reddytable tr.highlighttr td{background:#ffe599;} table.reddytable tr.selecttr td{background:#6aa84f;} .selected-counter,.highlighted-counter{margin-top:20px;font-weight:normal;font-size:12px;} .selected-counter span,.highlighted-counter span{font-weight:bold;font-size:16px;position:relative;bottom:-2px;} .selected-counter{color:#555;} .highlighted-counter{color:#2e4267;}
i can suggest jquery-bootgrid. have started use bootgrid myself seems promising html5 grid available @ moment.
see site several bootgrid related questions already. try edit or repost post jquery-bootgrid tag - believe author of bootgrid polling site assist questions. see author's site: http://www.jquery-bootgrid.com/
the examples , documentation on site wasn't extremely helpful me i'm real absolute beginner they're bit high level. if have little experience they'll great.
cheers
Comments
Post a Comment