Dynamic row adding.....
-
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..
-
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..
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.
-
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.
-
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 ...
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.