|
Lines 11-17
function hideColumns(){
Link Here
|
| 11 |
$("#showall").prop("checked", false).parent().removeClass("selected"); |
11 |
$("#showall").prop("checked", false).parent().removeClass("selected"); |
| 12 |
for( i=0; i<valCookie.length; i++ ){ |
12 |
for( i=0; i<valCookie.length; i++ ){ |
| 13 |
if(valCookie[i] !== ''){ |
13 |
if(valCookie[i] !== ''){ |
| 14 |
index = valCookie[i] - 2; |
14 |
index = valCookie[i] - 3; |
| 15 |
$("#itemst td:nth-child("+valCookie[i]+"),#itemst th:nth-child("+valCookie[i]+")").toggle(); |
15 |
$("#itemst td:nth-child("+valCookie[i]+"),#itemst th:nth-child("+valCookie[i]+")").toggle(); |
| 16 |
$("#checkheader"+index).prop("checked", false).parent().removeClass("selected"); |
16 |
$("#checkheader"+index).prop("checked", false).parent().removeClass("selected"); |
| 17 |
} |
17 |
} |
|
Lines 24-30
function hideColumn(num) {
Link Here
|
| 24 |
valCookie = $.cookie("showColumns"); |
24 |
valCookie = $.cookie("showColumns"); |
| 25 |
// set the index of the table column to hide |
25 |
// set the index of the table column to hide |
| 26 |
$("#"+num).parent().removeClass("selected"); |
26 |
$("#"+num).parent().removeClass("selected"); |
| 27 |
var hide = Number(num.replace("checkheader","")) + 2; |
27 |
var hide = Number(num.replace("checkheader","")) + 3; |
| 28 |
// hide header and cells matching the index |
28 |
// hide header and cells matching the index |
| 29 |
$("#itemst td:nth-child("+hide+"),#itemst th:nth-child("+hide+")").toggle(); |
29 |
$("#itemst td:nth-child("+hide+"),#itemst th:nth-child("+hide+")").toggle(); |
| 30 |
// set or modify cookie with the hidden column's index |
30 |
// set or modify cookie with the hidden column's index |
|
Lines 60-66
function showColumn(num){
Link Here
|
| 60 |
$("#"+num).parent().addClass("selected"); |
60 |
$("#"+num).parent().addClass("selected"); |
| 61 |
valCookie = $.cookie("showColumns"); |
61 |
valCookie = $.cookie("showColumns"); |
| 62 |
// set the index of the table column to hide |
62 |
// set the index of the table column to hide |
| 63 |
show = Number(num.replace("checkheader","")) + 2; |
63 |
show = Number(num.replace("checkheader","")) + 3; |
| 64 |
// hide header and cells matching the index |
64 |
// hide header and cells matching the index |
| 65 |
$("#itemst td:nth-child("+show+"),#itemst th:nth-child("+show+")").toggle(); |
65 |
$("#itemst td:nth-child("+show+"),#itemst th:nth-child("+show+")").toggle(); |
| 66 |
// set or modify cookie with the hidden column's index |
66 |
// set or modify cookie with the hidden column's index |
|
Lines 82-95
function showColumn(num){
Link Here
|
| 82 |
function showAllColumns(){ |
82 |
function showAllColumns(){ |
| 83 |
$("#selections").checkCheckboxes(); |
83 |
$("#selections").checkCheckboxes(); |
| 84 |
$("#selections span").addClass("selected"); |
84 |
$("#selections span").addClass("selected"); |
| 85 |
$("#itemst td:nth-child(2),#itemst tr th:nth-child(2)").nextAll().show(); |
85 |
$("#itemst td:nth-child(3),#itemst tr th:nth-child(3)").nextAll().show(); |
| 86 |
$.removeCookie("showColumns", { path: '/' }); |
86 |
$.removeCookie("showColumns", { path: '/' }); |
| 87 |
$("#hideall").prop("checked", false).parent().removeClass("selected"); |
87 |
$("#hideall").prop("checked", false).parent().removeClass("selected"); |
| 88 |
} |
88 |
} |
| 89 |
function hideAllColumns(){ |
89 |
function hideAllColumns(){ |
| 90 |
$("#selections").unCheckCheckboxes(); |
90 |
$("#selections").unCheckCheckboxes(); |
| 91 |
$("#selections span").removeClass("selected"); |
91 |
$("#selections span").removeClass("selected"); |
| 92 |
$("#itemst td:nth-child(2),#itemst th:nth-child(2)").nextAll().hide(); |
92 |
$("#itemst td:nth-child(3),#itemst th:nth-child(3)").nextAll().hide(); |
| 93 |
$("#hideall").prop("checked", true).parent().addClass("selected"); |
93 |
$("#hideall").prop("checked", true).parent().addClass("selected"); |
| 94 |
var cookieString = allColumns.join("/"); |
94 |
var cookieString = allColumns.join("/"); |
| 95 |
$.cookie("showColumns", cookieString, { expires : date, path: '/' }); |
95 |
$.cookie("showColumns", cookieString, { expires : date, path: '/' }); |