简体   繁体   中英

update div after jeditable submit in rails

i want to submit the text from jeditable, store it in the database and then i don´t want to render the updated text back to jeditable field, i want to update the whole div in which the jeditable field (and maybee other text fields) is.

fe

i change the username via jeditable inplace editor, then i store the changes in the db and now i want to update the complete div which contains the username (in place editor) and also other divs, cause after the username changes, the email changes, too.

You can probably use the callback function to make a second AJAX call to get the new data.

  $('.editable').editable('http://www.example.com/save.php', { 
     type     : 'textarea',
     submit   : 'OK',
     callback : function(value, settings) {
        $("AREATOBEUPDATED").load("URL THAT RETURNS FULL CONTENT OF AREA");
      }
  });

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM