Forums

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

  • This topic is empty.
Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #239619
    Paulie_D
    Member

    Those look like custom attributes…not standard ones…they’re probably using them as JS hooks themselves I imagine.

    #239620
    Kognak
    Participant

    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 ?

    #239621
    Paulie_D
    Member
    #239622
    Kognak
    Participant

    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…

    #239651
    Kognak
    Participant

    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 !

Viewing 5 posts - 16 through 20 (of 20 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.