NicolasCARPi / jquery_jeditable

jQuery edit in place plugin. Extendable via plugin architecture. Plugins for plugin. Really.
https://jeditable.elabftw.net
MIT License
1.74k stars 459 forks source link

Edited data is saved in to DB, but input field gets "Click to edit... " text. #111

Closed Sharppis closed 11 years ago

Sharppis commented 11 years ago

I'm able to edit data and even able to save it into db, but value disappear from the screen and is replaced with "Click to edit..." text. In other words, div's content, which used to be non-edited, isn't replaced with edited conten, it's replaced with "Click to edit...". Behind the scenes right value and id is sent to save.php, in my case testi_details.php?func=3, where func=3 is information for page to pick up right function for this case.

When I refresh page, edited value will be there and everything is fine. What I'am doing wrong?

$('.edit-money').editable('testi_details.php?func=3', { indicator : 'Saving...', submit: 'OK', id : 'elementid', value : 'newvalue' });

I'm not sure does it effect, but editable div is located in the table which rows' content is fetched from the db. Perhaps not...

I tried to add .done() and .always(); with load(); but it didn't do the magic.

Sharppis commented 11 years ago

Note to myself... remember give some results in "save.php" file. I didn't have nothing there.

I'm using jeditable in table where rows are items and each item has price. Like a shopping list. If I edit item's value increasing or decreasing and want this change effect in the sum of all rows in table, I added $("#tablediv").load(); to load content. Now I have new sum right after edited value is saved.