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
-
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
-
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 ?
Yes, don’t think of it as the dialog being able to consume json data. Do this:
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:
Please note that there is a LOT of pseudocode/hand waving in that example but it should give you the basic approach.