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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Hide subgrid column - ...
Power Pages
Answered

Hide subgrid column - can't reach TD element

(0) ShareShare
ReportReport
Posted on by 97

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?

 

 

Categories:
  • Saud Ali Profile Picture
    812 Super User 2024 Season 1 on at

    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.

  • RK2021 Profile Picture
    97 on at

    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.

     

  • Verified answer
    oliver.rodrigues Profile Picture
    9,482 Most Valuable Professional on at

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Pages

#1
M Bilal Khan Profile Picture

M Bilal Khan 139

#2
Mohsin Ali Profile Picture

Mohsin Ali 41

#3
11manish Profile Picture

11manish 21 Super User 2026 Season 2

Last 30 days Overall leaderboard