Topic
  • 2 replies
  • Latest Post - ‏2013-02-25T14:31:21Z by SystemAdmin
SystemAdmin
SystemAdmin
7615 Posts

Pinned topic Adding an event to a dynamically populated table - 8.0.1

‏2013-02-25T10:50:01Z |
I am trying to add an on click event to each row of a set of tables. These tables are created dynamically by binding a list of lists to a vertical section with a table inside.

To add the event I am trying to access the tr tags with a dojo script in an html content but it is returning an empty set of values for my queries. Apparently a skeleton of the page is rendered once, the script is ran and then the tables created.

I tried to use dojo's ready function but the resultswere the same. Any ideas?
Updated on 2013-02-25T14:31:21Z at 2013-02-25T14:31:21Z by SystemAdmin
  • kolban
    kolban
    3316 Posts

    Re: Adding an event to a dynamically populated table - 8.0.1

    ‏2013-02-25T13:40:17Z  
    I'd probably suggest creating a new Coach View that encapsulates a button. You could then add that Coach view to your template and an instance of the button (Coach View) would be created for each replication including any event calling defined for that Coach View. Out of interest, what is the function of the event you wish to process? What do you want it to do?

    Neil
  • SystemAdmin
    SystemAdmin
    7615 Posts

    Re: Adding an event to a dynamically populated table - 8.0.1

    ‏2013-02-25T14:31:21Z  
    • kolban
    • ‏2013-02-25T13:40:17Z
    I'd probably suggest creating a new Coach View that encapsulates a button. You could then add that Coach view to your template and an instance of the button (Coach View) would be created for each replication including any event calling defined for that Coach View. Out of interest, what is the function of the event you wish to process? What do you want it to do?

    Neil
    Yes, someone else suggested me just that and I have since copied the table coach view and adapted it's inline javascript to add a custom event to each row.

    The objective is to redirect the user to a link from a hidden column in the table.

    So far I have managed to connect an event to each row but it is being executed twice. After I solve that I'll try to find a away to access the url information from that row.