Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

edit a cell of a table

 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to edit a particular cell of a row in a table containing many rows in a Javascript function, i.e I got the table and the row,cell;I have to now make it editable so that the user can modify it.How does one achieve it?
 
marten kay
Ranch Hand
Posts: 178
Java jQuery Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if it's unformatted text, then you could get the td's text node and delete it from the Dom and replacing it with a textarea that has a value equivalent to that text node, you would then need to reverse the process after the text area has has been edited to the desired value.

If it's formatted text, you may need to use designMode such as RichTextEditingDemo, or use another existing rich text editing JS tool.
 
Pradeep Adibatla
Ranch Hand
Posts: 336
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there something like ,



in java script to edit a row, if 'row' in the above is the row selected??


 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to make the cell hold a textbox or textarea. You can style them to have no border so it will look seamless. ANother option is to look at JavaScript code called "Edit In Place"

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic