Insert new row before current row

Discussion in 'Javascript' started by Andrus, Jun 29, 2003.

  1. Andrus

    Andrus Guest

    I want to insert empty row before current row in data bound table.
    Unfortunately, the row is added to end of table.

    To reproduce:

    1. Run the code in the end of this message in IE 5.5+
    2. Right-click in some row

    Observed result:

    Row is added to end of table

    Expected result:

    Row must be inserted before the right-clicked row


    Any idea how to insert a row before current row to table ?



    Code to reproduce:

    <xml id="result" javaDSOCompatible="true"><result>
    <row><item>pine</item><quantity>2</quantity><price>2.23</price></row>
    <row><item>apple</item><quantity>3</quantity><price>1</price></row>
    <row><item>orange</item><quantity>2.3</quantity><price>4.5</price></row>
    </result></xml>

    <TABLE DATASRC="#result">
    <thead><th>Item</th><th>Price</th><th>Quantity</th>
    </thead>

    <tr
    oncontextmenu="
    result.recordset.AbsolutePosition=event.srcElement.recordNumber;
    result.recordset.AddNew();
    return false;
    ">
    <td><input type=text datafld=item></input></td>
    <td><input type=text datafld=price></input></td>
    <td><input type=text datafld=quantity></input></td>
    </tr></TABLE>
     
    Andrus, Jun 29, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Quentin Huo
    Replies:
    2
    Views:
    8,324
    diehardguy
    Jul 18, 2006
  2. Phil Winstanley [Microsoft MVP ASP.NET]

    Re: how to get the new identity ID just after insert a new row?

    Phil Winstanley [Microsoft MVP ASP.NET], Jun 11, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    11,341
    Quentin Huo
    Jun 11, 2004
  3. Dan Sikorsky
    Replies:
    2
    Views:
    11,493
    SiliconViper
    Apr 30, 2009
  4. Hanno

    Make new record current in DetailsView after Insert

    Hanno, Aug 5, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    197
    Hanno
    Aug 5, 2006
  5. Giggle Girl

    ie6 Insert Row at specific Row Index of Table

    Giggle Girl, Feb 5, 2006, in forum: Javascript
    Replies:
    18
    Views:
    281
    Thomas 'PointedEars' Lahn
    Feb 7, 2006
Loading...

Share This Page