0

I have a data table and I add rows from a button at the top of the table. I also am able to select rows. I would also like to be able to edit those selected rows even if they are newly added. I use something like this to select a row even if it's newly added.

$("table").on("click", 'tr', {someinfo}, this.onRowSelected);

I would like to do something similar to edit the selected row. So I have an edit button, and when I press it, I want the selected row to be ready to edit (using jeditable). I have seen Jeditable - Activate edit of X by clicking on Y, but I can't seem to figure out how to handle the .editable(). Since the .editable() needs to be live, I want to use .on() to add it in. Does anyone have an idea what the syntax for that would look like?

Here is the code on jsfiddle

Everything but the jeditable stuff works fine. Any ideas? Thanks for your time.

Community
  • 1
  • 1
user197674
  • 748
  • 2
  • 7
  • 22

1 Answers1

0

I got it figured out. With some help from a more experienced javascript guy, I figured out these things:

  1. The .editable() needs to be done before the event is triggered.
  2. The .trigger() needs to be called from the element that has the editable().

Here is an updated fiddle that works except for updating after editing (I was just having some fun with the JSON stuff. It's a fiddle isn't it?)

user197674
  • 748
  • 2
  • 7
  • 22