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?
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/
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.
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.
Fubar
69
Super User 2025 Season 1
oliver.rodrigues
49
Most Valuable Professional
Jon Unzueta
43