Jump to content

Hiding Aggregate Columns (td)


Recommended Posts

I'm struggling getting some CSS correct in a tabular datapage and could use some help. Aggregate rows do not respond to hiding columns in the same way that data rows do when deployed. (See screenshots)

In this example, I'm trying to hide three extra cells in the aggregate row. When I preview the datapage it works. When I deploy the datapage, it does not.  Note that the first 4 sets of table selectors all work.

Here's the CSS in my header element:

<style>
<!-- WORKS: -->

#dashtable table:nth-of-type(1) td:nth-of-type(9)  {display: none;}
#dashtable table:nth-of-type(1) th:nth-of-type(9)  {display: none;}

#dashtable table:nth-of-type(1) td:nth-of-type(7)  {display: none;}
#dashtable table:nth-of-type(1) th:nth-of-type(7)  {display: none;}

#dashtable table:nth-of-type(1) td:nth-of-type(8)  {display: none;}
#dashtable table:nth-of-type(1) th:nth-of-type(8)  {display: none;}

#dashtable table:nth-of-type(1) td:nth-of-type(6)  {text-align:center;}
#dashtable table:nth-of-type(1) th:nth-of-type(6)  {text-align:center;}

<!-- PREVIEW WORKS, DOES NOT WORK WHEN DEPLOYED: -->
#dashtable .cbResultSetTotalsDataCell {display:none;}

</style> 
<div id="dashtable">

(closing "div" is in footer element. )

Thoughts? 

1-display_correct.JPG

1-display_incorrect.JPG

Link to comment
Share on other sites

  • 2 weeks later...

Hi Clint,

 

Just to verify that we don't miss the standard way of doing stuff, though it's kind of obvious, would you want to hide the whole column?

If so, you can just remove the field in Select Results Page Fields, or set its form element to Hidden in Configure Results Page Fields > field > Editing.

Else, it's much better if you can provide your DataPage, probably with sample data and via Deployment URL / Exported file to better help you.

 

Regards,

DN31337

Link to comment
Share on other sites

  • 4 weeks later...

Unfortunately I can't share the datapage because it's authenticated. 

I'm tracking with you on hidden elements. However, this is not an element. Caspio adds columns to tables when using an aggregate field.  And, one cannot hide formula columns, which are required when loading in data via SQL for other calculations (except via CSS). Hiding columns via CSS works, as long as you don't mind the the extra aggregate columns showing (as in the original attached photo). 

Any other things to try? There must be a way to specify that column in that row... 

Link to comment
Share on other sites

  • 3 years later...
On 9/25/2018 at 9:33 AM, Clint said:

I'm struggling getting some CSS correct in a tabular datapage and could use some help. Aggregate rows do not respond to hiding columns in the same way that data rows do when deployed. (See screenshots)

In this example, I'm trying to hide three extra cells in the aggregate row. When I preview the datapage it works. When I deploy the datapage, it does not.  Note that the first 4 sets of table selectors all work.

Here's the CSS in my header element:

<style>
<!-- WORKS: -->

#dashtable table:nth-of-type(1) td:nth-of-type(9)  {display: none;}
#dashtable table:nth-of-type(1) th:nth-of-type(9)  {display: none;}

#dashtable table:nth-of-type(1) td:nth-of-type(7)  {display: none;}
#dashtable table:nth-of-type(1) th:nth-of-type(7)  {display: none;}

#dashtable table:nth-of-type(1) td:nth-of-type(8)  {display: none;}
#dashtable table:nth-of-type(1) th:nth-of-type(8)  {display: none;}

#dashtable table:nth-of-type(1) td:nth-of-type(6)  {text-align:center;}
#dashtable table:nth-of-type(1) th:nth-of-type(6)  {text-align:center;}

<!-- PREVIEW WORKS, DOES NOT WORK WHEN DEPLOYED: -->
#dashtable .cbResultSetTotalsDataCell {display:none;}

</style> 
<div id="dashtable">

(closing "div" is in footer element. )

Thoughts? 

1-display_correct.JPG

1-display_incorrect.JPG

 Hi,

Jus to add, you may refer to this link on how to hide (or do any other CSS) multiple sibling elements all at once:

 

Link to comment
Share on other sites

  • 1 year later...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...