SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Event wiring

  1. #1
    SitePoint Zealot tss68nl's Avatar
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Event wiring

    I have a data control which gets initialized on the page. This data control exposes a couple of events, of which one is the 'onRowEnter' event, which gets fired whenever a new row gets selected in that data control.

    Now, I have an arbitraty amount of grids (databound tables with extra features) and handwritten databindable forms which present the data 1 record at a time. I want these grids etc to subscribe to the onRowEnter-event of the data control, so that they can update their views whenever the current record changes. (I want to let them subscribe themselves, since it can happen that the datacontrol is ready, while other objects are still loading, which will result in an error if the specified grids do not exist yet)

    How would I go about doing that ? When I use the DataIsland.attachEvent("onRowEnter", someFunction) - directive, I can only specify a declared function, without any parameters. Also, I tried to specify <grid ID>.someFunction, but jscript wont take that as a function name.

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Have you tried passing an anonymous function into the attachEvent method? Then you can just pass your parameters into the function inside the anonymous block.
    Code:
    DataIsland.attachEvent("onRowEnter", 
    function () {
    someFunction(param1, param2, param3);
    });


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •