Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Dynamic row adding.....

Dynamic row adding.....

Scheduled Pinned Locked Moved Web Development
helpquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    SamRST
    wrote on last edited by
    #1

    hi all, i have a Multiple entry page in which the rows of a table will be added dynamically using javascrpit. when i added new rows, it will added at the bottom the table, ie as last row. but when i added more than 20 / 30 rows, i cannot see the last entered data without scrolling. so i want to add this new row as first row in the table. how can i achieve this. i used following code to add rows dynamically: var parentObj = document.getElementById('Table1'); var row = document.createElement("tr"); var cellA= document.createElement("td"); var cellB= document.createElement("td"); var cellC= document.createElement("td"); row.appendChild(cellA); row.appendChild(cellB); row.appendChild(cellC); parentObj.appendChild(row); Please help to sort out this..

    S 1 Reply Last reply
    0
    • S SamRST

      hi all, i have a Multiple entry page in which the rows of a table will be added dynamically using javascrpit. when i added new rows, it will added at the bottom the table, ie as last row. but when i added more than 20 / 30 rows, i cannot see the last entered data without scrolling. so i want to add this new row as first row in the table. how can i achieve this. i used following code to add rows dynamically: var parentObj = document.getElementById('Table1'); var row = document.createElement("tr"); var cellA= document.createElement("td"); var cellB= document.createElement("td"); var cellC= document.createElement("td"); row.appendChild(cellA); row.appendChild(cellB); row.appendChild(cellC); parentObj.appendChild(row); Please help to sort out this..

      S Offline
      S Offline
      SomeGuyThatIsMe
      wrote on last edited by
      #2

      dont, pick one place or another to add rows, the user will get used to seeing the rows added to the bottom and wont check the top when they add the 31st row and will therefore think it didnt get added. if there is no "insert" function, you will probably have to read in all the elements, clear them, then write yours first then readd everything else. or use somethting that runs server side, like a datagrid or listview, or a dozen other options. if you dotn want to see a postback use AJAX or something ajax like.

      Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      S 1 Reply Last reply
      0
      • S SomeGuyThatIsMe

        dont, pick one place or another to add rows, the user will get used to seeing the rows added to the bottom and wont check the top when they add the 31st row and will therefore think it didnt get added. if there is no "insert" function, you will probably have to read in all the elements, clear them, then write yours first then readd everything else. or use somethting that runs server side, like a datagrid or listview, or a dozen other options. if you dotn want to see a postback use AJAX or something ajax like.

        Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

        S Offline
        S Offline
        SamRST
        wrote on last edited by
        #3

        unfortunately , i cannot use Server-side controls bcose , the user will enter more than 50 records at a time, and its not so safe to use ajax bcose the network is too low... Plz suggest ...

        S 1 Reply Last reply
        0
        • S SamRST

          unfortunately , i cannot use Server-side controls bcose , the user will enter more than 50 records at a time, and its not so safe to use ajax bcose the network is too low... Plz suggest ...

          S Offline
          S Offline
          SomeGuyThatIsMe
          wrote on last edited by
          #4

          if you arent using server side code what are you doing with the rows once they are added? i've used ajax and it runs fairly quickly if you do it right, you just have to be more careful with how you write the server code because poorly written code runs slower and with ajax people are more likely to notice.

          Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups