Jquery/Javascript not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gits
    Recognized Expert Moderator Expert
    • May 2007
    • 5390

    #16
    it's not i guess. as i said - the handling for the select is applied to all! select nodes in the page. I guess the tablerows should only react to the select-node in the 'Sibling Detail' section? now simply open that section and for example 'Collapsible Group 3' as well. use the select node in that section to chose Yes/No for example - and it will show all the tablerows. i doubt that this is the intention. you would need to check from which select node the event comes from - by an id or an attribute that identifies that - or simply only add the handler to that single select-node.

    Comment

    • jagaurav
      New Member
      • Aug 2016
      • 11

      #17
      Gits you are right.. I didnt actually notice that. Can you please help me in adding the handler as I am not that technical ? Thanks

      Comment

      • gits
        Recognized Expert Moderator Expert
        • May 2007
        • 5390

        #18
        since i'm not going to write the code for copy and pasting i give you 2 hints that you could use to fix that issue:

        1. you can give the select node that you want to handle an id or whatever other attribute (for example a name) that you can check additionally in the current handler code and only in case the events come from that node - handle the table rows. This would allow you to handle all the select's events in a central place. There are different possibilities to implement it like that.

        2. given the fact that you would give the node a unique attribute you could even change the 'apply' mechanism by not selecting all nodes in the first place but only that one you really want. In this case you would have a handler for that specific node only and the other selects would need their own custom handlers applied as well if you ever want them to have one.

        Both solutions would work - with the described basic ideas behind them. it would depend on how you think you will extend the code from there on, i cannot really say that one would be 'better' then the other while i don't know the further plans, that might imply that one implementation could have an advantage over the other.

        when you show what you have tried then we might be able to help you further in case you would have problems with a specific solution.

        best regards.
        Last edited by gits; Aug 31 '16, 07:50 AM.

        Comment

        • jagaurav
          New Member
          • Aug 2016
          • 11

          #19
          Thanks gits. I have managed to get this working now. Thanks for your idea

          Comment

          Working...