web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : vzgrBr+k7P0u56sp8KtiAG
Power Pages - Customize & Extend
Answered

Hide subgrid column - can't reach TD element

Like (0) ShareShare
ReportReport
Posted on 21 Jun 2023 12:16:42 by 87

Hi all

 

I am looking to hide a column on a basic form subgrid using JS at the Web template level.

 

I have done this successfully with fields and list columns, but when traversing the DOM to reach the <TD> element I need, I can't seem to reach it. That is, the .grid-view element has child elements in the DOM (table body and so on) but my jQuery .children() call returns nothing.

 

Am I missing something or are subgrid elements not accessible?

 

 

  • Verified answer
    oliver.rodrigues Profile Picture
    9,342 Most Valuable Professional on 22 Jun 2023 at 20:48:06
    Re: Hide subgrid column - can't reach TD element

    hi @RK2021 can you try the code from this article?: http://oliverrodrigues365.com/2020/07/19/power-apps-portals-javascript-tip-01-hide-show-elements/

     

  • RK2021 Profile Picture
    87 on 22 Jun 2023 at 15:21:33
    Re: Hide subgrid column - can't reach TD element

    Thanks for this code, I have tried it and other variants, but it seems the tr and TD elements in the subgrid cannot be reached. Even doing .find() for all TR elements only finds the document grid, not the two subgrids I have on the form.

     

    Perhaps it's related to the message in the documentation that validation code cannot be applied to subgrids? Perhaps they are beyond client-side scripting.

     

  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on 21 Jun 2023 at 20:58:18
    Re: Hide subgrid column - can't reach TD element

    Hi @RK2021 ,

     

    Here is the sample code by using which I can reach out to my table's first td and can hide it. This is a sample you can modify according to your needs.

     

    var tdElement = $('table td:eq(1)'); //Fetching first column of my table
    tdElement.hide();

     

    Thanks,

    Saud

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
Lucas001 Profile Picture

Lucas001 60 Super User 2025 Season 2

#2
Fubar Profile Picture

Fubar 55 Super User 2025 Season 2

#3
surya narayanan Profile Picture

surya narayanan 35

Featured topics

Loading complete