Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2005
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Append a new row to a table / datagrid

    Hi All,
    Appologies if this was answered recently but I cannot see it anywhere,

    Basically I have a large HTML pages generated from a datagrid.

    A user needs to be able to create a row that will be appended to the bottom of the table such that it can be processed the next time the page is posted to the server.

    Could someone please provide an example of how I can accomplish this using Javascript?

    Any help would be really appreciated.

    Cheers,
    Paul.

  • #2
    don
    don is offline
    New Coder
    Join Date
    Sep 2002
    Posts
    76
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't know if it will work with a datagrid, but this is how you can add a row to a table and add class/style stuff:

    function addRow(tbl) {
    var t=document.getElementById(tbl)
    var tr=t.insertRow(1)
    tr.style.height="20"
    tr.className = "sampleRow"
    var td=tr.insertCell(0)
    td.innerHTML="<a class='sampleCell' href='http://foo.com'>Bar</a>"
    }

    For more information, see http://www.mozilla.org/docs/dom/domr...tml_ref31.html


  •  

    Posting Permissions

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