Forums
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
Home › Forums › JavaScript › Hide a row when input disabled
Those look like custom attributes…not standard ones…they’re probably using them as JS hooks themselves I imagine.
You mean I can check on JS of the plugin which generates the table to find how they work with the attribute and then I can do the same ?
I feel so close thanks to you but… still doesn’t work. I can’t believe I can’t understand the logic behind Jquery…
Here’s the right Codepen, I updated with your code.
http://codepen.io/Kognak/pen/yOMYRp
As you can see on HTML side, the attributes=”size” is inside <tbody> (and there’s 2 <tbody> inside the same <table>), and not inside <table>. That’s why it doesn’t work for me.
So, I naively thought I just had to overwrite “table” with “tbody” (as you can see on my Codepen), but no, it doesn’t work that way.
I think I better speak Chinese than jquery…
I think I understand what’s wrong !
Codepen again :
http://codepen.io/Kognak/pen/yOMYRp
The code doesn’t specify to apply that logik, that rule, only for each tbody after each tbody.
On my Codepen, I’ve the first tbody with half rows activated, other half disabled, and the second tbody with 100% rows disabled. But for that’s still input not disabled > 0, that’s why it displays all the tbodies !
The solution would be : dear Jquery, check the input disabled on the rows of each tbody, if the row has input disabled, then hide it AND if one tbody has at least 1 row not disabled, display this tbody, if not, hide this tbody.
And of course the question is : how to achieve this !
Did I understand and set the problem correctly ? :)
PS : presently I feel I learn a lot !