×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    6

    Table and event handling

    Hi Pals,

    I am new to Javascript coding. I know very little about it. I am writting widget for S60 5th edition device, N97 mini in particular.
    In HTML page, I have table, I want to handle event for each row. How can I do it? Please advice.
    Here is snap of code which I have written.
    For row with "22" I want to raise a event when I touch on screen & for "33" also I want to raise event on touch.
    --------------------Start-------------------
    <html>
    <head>
    <script type="text/javascript">
    function addRow(content,morecontent)
    {
    if (!document.getElementsByTagName) return;
    tabBody=document.getElementsByTagName("TBODY").item(0);
    row=document.createElement("TR");
    cell1 = document.createElement("TD");
    cell2 = document.createElement("TD");
    textnode1=document.createTextNode(content);
    textnode2=document.createTextNode(morecontent);
    cell1.appendChild(textnode1);
    cell2.appendChild(textnode2);
    row.appendChild(cell1);
    row.appendChild(cell2);
    tabBody.appendChild(row);


    }
    </script>
    </head>
    <body>
    <table border='1' id='mytable'>
    <tbody>
    <tr><td>22</td><td>222</td></tr>
    <tr><td>33</td><td>333</td></tr>
    </tbody>
    </table>
    <button onClick='addRow("123","456");return false;'>
    Add Row</button>
    </body>
    </html>
    ----------------End----------------------------------------

    Regards,

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: Table and event handling

    have you tried using mouse events for detecting the user pressing the screen already ?

Similar Threads

  1. Event handling
    By manojpaul in forum Mobile Java General
    Replies: 11
    Last Post: 2009-07-14, 09:54
  2. event handling
    By jselvakumar26071988 in forum Mobile Java General
    Replies: 3
    Last Post: 2009-01-09, 22:58
  3. key handling and handling event??
    By bakidilek in forum Symbian
    Replies: 4
    Last Post: 2009-01-02, 17:35
  4. A question about multiple views and key event handling
    By EeroS in forum Symbian User Interface
    Replies: 2
    Last Post: 2007-07-13, 09:35
  5. Replies: 1
    Last Post: 2003-08-25, 11:22

Posting Permissions

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