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

  • SEARCH
  • Home
  • 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 6142609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:24:40+00:00 2026-05-23T18:24:40+00:00

I have a Rails application. I show multiple rows of data on the page.

  • 0

I have a Rails application. I show multiple rows of data on the page. For each row I want to create a button that will show some extra data on a popup for that row.

I checked following

  1. jQuery ui Dialog ( http://jqueryui.com/demos/dialog/ )

    • Doesn’t give option to get data with ajax query,
    • I don’t want hidden data for each row
  2. jQPOOOP jQuery plugin
    http://plugins.jquery.com/project/jQPOOOP

    • looks like works on html data, I want something that may work on json data

Is there any way to build something using only jquery ui dialog but which work on json data retrieved from an ajax request ?

  • 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-23T18:24:41+00:00Added an answer on May 23, 2026 at 6:24 pm

    Yes, don’t think of it as the dialog being able to consume json data. Do this:

    1. fire your ajax
    2. in your handler prepare and reveal the dialog
    3. in the button handler for the dialog, if you want, fire more ajax and then handle the results.

    The key is to think of the dialog differently than the examples you see on the jQuery UI website. Populate the dialog dynamically by plowing through the JSON return values and use the jQuery selectors to find what you need, create more and insert new elements to the dialog content.

    Here is a more concrete example:

    $( "#dialog" ).dialog({
    modal: true,
    buttons: {
          Ok: function() {
            fire_ok_ajax_with_handler(); //pretend the handler is ok_handler
    
        }
      }
    });
    
    
    // this method is called when the action the user takes wants to
    // open the dialog. Note that it doesn't actually open the dialog
    // but instead starts the ajax process of getting the data it needs
    // to prepare the dialog
    $( "#opener" ).click(function() {
      $( "#dialog" ).dialog( "open" );
        fire_ajax_to_start_stuff();
        return false;
    });
    
    function fire_ajax_to_start_stuff(...) {
        // assume start_handler method
    }
    
    function start_handler(data) {
      //process data, which can be json if your controller formats it that way
      // use the data to dynamically setup the dialog,
      // show the dialog
      $( "#dialog" ).dialog( "open" );
    }
    
    function fire_ok_ajax_with_handler() {
      // this is where you set up the ajax request for the OK button
    }
    
    function ok_handler(data) {
      // handle possible errors messages
      // close the dialog
      $( this ).dialog( "close" );
    }
    

    Please note that there is a LOT of pseudocode/hand waving in that example but it should give you the basic approach.

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

Sidebar

Related Questions

I have an rails a application whereby it has a page that contains a
I have a single Rails 2.2.2 app that I want to 'share' with multiple
I have a Ruby on Rails application that allows for users to create a
I have a rails application where each user has a separate database. (taking Joel
I have a Rails application that in the erb code, I use a select
We have a rails application in subversion that we deploy with Capistrano but have
I have a Rails application that unfortunately after a request to a controller, has
I have a rails application deployed that works fine in Safari, Firefox, and Opera.
I have a rails application that about 3 years old, and I'm having a
I have a Rails application that uses ActiveRecordStore for sessions. I need a PHP

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.