Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4026758
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:00:42+00:00 2026-05-20T11:00:42+00:00

Want to update page after jeditable (using gem on_the_spot) has been updated. Below works

  • 0

Want to update page after jeditable (using gem “on_the_spot”) has been updated. Below works updating page, but after script runs once fields are no longer updatable with jeditable.

application.js

$('.on_the_spot_editing').change(function() {
   $.getScript('edit.js');
});

edit.js.erb

$("#items .on_the_spot_editing").change();
$("#edit_order_form").html("<%= raw escape_javascript(render('form')) %>");

Controller

respond_to do |format|  
  format.html  
  format.js if request.xhr?
end

field

<%= on_the_spot_edit item, :price %>

EDIT –

$(document).ready(function(){
  $('.on_the_spot_editing').data('ok', 'Ok').live('click', function() {
    //  tried $.delay(800).getScript('edit.js');
    $.getScript('edit.js');
  });
});

EDIT 2 – If data-ok=”Ok” is the html5 mark up, would this be correct to see if user clicked the “Ok” button?

$('.on_the_spot_editing').data('ok', 'Ok').live('click', function() {
  setTimeout(getIt, 500);
});

function getIt() {
  $.getScript('edit.js');
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:00:43+00:00Added an answer on May 20, 2026 at 11:00 am

    First remark: I do not quite understand why inside your edit.js you need to re-trigger the change event? Shouldn’t that create a loop? It would if … a-ha!

    Since you re-render the form, you lose all event bindings. You should use live bindings. Unfortunately jEditable does not use live binding. Presumably because it didn’t exist when jEditable was written, and secondly, I presume because if you are going to use javascript to edit a single field, you would not want to re-render the complete form again.

    If you still want to re-render the complete form, and there could be valid cases to do so (code resides on the controller, update counters/states/what not): make sure that inside your form view, you also load the on_the_spot.js again. That will re-enable the form.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For example, when I want to update a part of my page with AJAX
SKIP TO UPDATE 3 I want to enable the Seam debug page on Weblogic
How can I keep checkboxes selected after the form has been submitted? I found
I want to partially update page when i upload or delete the image. What
I am using ajax to update the db with a new folder but it
I'm using AJAX on an ASP.NET web project to update a page. Some of
I want to update the dnn's default page redirect to one of the custom
I want to Refresh aspx page after closing a jquery modal dialog on clicking
I am trying to update a small area in my web page.I just want
I want to refresh my asp.net page after someone clicks an Add button. However,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.