• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Dynamically Adding & removing rows

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
inserting /Removeing rows elements in javascript

[ April 04, 2008: Message edited by: RAVI KHARVI ]
[ April 05, 2008: Message edited by: RAVI KHARVI ]
 
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Indeed. And what exactly do you want to control dynamically?
 
Ranch Hand
Posts: 1325
Android Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ravi,

Welcome to Javaranch.

I would like to suggest some reading about Use A Meaningful Subject Line and Tell The Details.
 
Anirvan Majumdar
Ranch Hand
Posts: 261
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by RAVI KHARVI:
how to add or remove rows in javascript at dynamicaly



Well,
1) You could represent every row as a separate table giving each table a unique id. And then toggle around with the table's style.display property to show and hide the tables.
2) Instead of having separate tables for every row, you can try and toggle with the style.display property of the <tr> elements. This will work fine with IE but other browsers don't really allow this behaviour. For cross browser operation, you can try changing the className of the <tr>'s: where one class has a property {display:none;} and the other has nothing.
3) You can alter the innerHTML property of the table, but this is often very cumbersome.
[ April 04, 2008: Message edited by: Anirvan Majumdar ]
 
Ranch Hand
Posts: 269
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look into JQuery. You should use 1 table. Each row should have a unique id. Then you can do something like... $('#'+id).remove();

You could also look into jqGrid. It has row adding and deleting features. It is a plugin to JQuery. So I would start here.
reply
    Bookmark Topic Watch Topic
  • New Topic