posted 9 years ago
I'm venturing into some new territory here, making a table with editable fields using DataTables and JEditable. Here's the function that manages the editable fields.
Now, everything works, but here is my concern. That "return(value)" is required for the editable field to return to a non-editable state and display the new value. But since it's outside the ajax call, it's always going to display the new value even if the database update fails. If I put the return inside the "success" function, the editable field doesn't "see" it and stays stuck in editable mode with the old value displayed.
I realize that most people use JEditable by letting it do a POST as soon as the user presses enter, sending the value and element ID. But I'm using the option to send it to a function because I have to get the value of two other fields in the row before I can determine which record is being updated.
I not sure how to work around this one...
"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson