wgalliance Posted October 10, 2016 Report Share Posted October 10, 2016 I would like to hide a column in a tabular report IF it meets a specific criteria. I have looked at several forum posts including the following: http://howto.caspio.com/tech-tips-and-articles/advanced-customizations/how-to-dynamically-change-the-background-of-a-results-page/?_ga=1.209653078.530491687.1457713192 and Currently I have the following script added to the footer: <script> var isi = document.getElementById("visi[@field:CFC_zones_OPM_Name]"); if('[@authfield:User_Table_WGAusers_Access_Level]' == 'Finance'){ isi.style.display = 'none'; } </script> Help would be appreciated. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted October 11, 2016 Report Share Posted October 11, 2016 To hide particular columns (and column header) in tabular report page, add the following codes to the header and the footer This goes in header: <style> #target table:nth-of-type(2) td:nth-of-type(3) {display: none;} #target table:nth-of-type(2) th:nth-of-type(3) {display: none;} #target table:nth-of-type(2) td:nth-of-type(4) {display: none;} #target table:nth-of-type(2) th:nth-of-type(4) {display: none;} #target table:nth-of-type(2) td:nth-of-type(5) {display: none;} #target table:nth-of-type(2) th:nth-of-type(5) {display: none;} </style> <div id="target"> Add this to the footer: </div> The above style will hide columns 3,4 & 5. The number in table:nth-of-type(2) depends on your result page design. If your result table is the first on the result page (case when you don't have download, or sort by dropdown or has a search form), this number should be 1. If you have download or sort by, or pre-defined criteria this number should be 2. Number in td:nth-of-type(3) shows which column you want to hide. 1 refers to the first column, 2 second column and so on.. You might be able to change this solution and make it conditional ?!?!?! Quote Link to comment Share on other sites More sharing options...
wgalliance Posted October 12, 2016 Author Report Share Posted October 12, 2016 Yes I have followed a previous post of yours to hide some columns that done need a condition. It's when I add the condition that I don't know how to make it work. Quote Link to comment Share on other sites More sharing options...
wgalliance Posted November 14, 2016 Author Report Share Posted November 14, 2016 In case anyone comes across this post, I did finally find an answer to my question. If I deploy the style to hide the column in the header of the WEBPAGE (vs header of the caspio page) then I can conditionally hide columns. Based on what page I am on, I hide different columns. Works perfect! Quote Link to comment Share on other sites More sharing options...
Meekeee Posted January 7, 2022 Report Share Posted January 7, 2022 Quote Link to comment Share on other sites More sharing options...
bookish Posted May 11 Report Share Posted May 11 On 11/14/2016 at 9:55 PM, wgalliance said: In case anyone comes across this post, I did finally find an answer to my question. If I deploy the style to hide the column in the header of the WEBPAGE (vs header of the caspio page) then I can conditionally hide columns. Based on what page I am on, I hide different columns. Works perfect! I am looking for this. Thank you @wgalliance When you say Webpage, do you mean the datapage has to be embededded somewhere? Will it not work in a deployed caspio URL? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.