Hi Bryan
On Tuesday, July 3, 2012 3:19:08 PM UTC+1, Bryan Larsen wrote:
>
> You shouldn't need to play with the data-rapid attribute if you're 
> using an existing tag.   You may need to understand it if you're 
> creating a new jQuery tag, so more documentation is probably 
> warranted, but if you're just using an existing tag, you shouldn't 
> need to play with it directly. 
>
> In this case, try: 
>
> <dialog-box id="dialog-for-item-#{this.id}" ...>...</dialog-box> 
>
> <dialog-open-button dialog="#dialog-for-item-#{this.id}"/> 
>
> Note the two different uses for hash.   #{...} is for embedded ruby, 
> but "#dialog-..." is a CSS selector. 
>
> Also note the two different meanings of ID.  There's the ActiveRecord 
> ID (this.id), and there's the CSS ID (dialog-for-item-17).   We're 
> using one to build the other but they are distinct. 
>

thank you for explaining this. Your suggestion works, but unless I'm 
missing something this approach pre-populates a dialog for every item. 

In our use-case we create a kanban board with a card for each "item" - 
so we can have maybe several hundred "items" on a single show page. The 
current design is that we only load titles+ids to populate the board, 
then if the user clicks on a specific card we pull the full item record 
into a popup dialog. Creating dialogs for all of the items is too big and 
slow, hence the current Hobo.ajaxRequest call. I noticed in the 1.4 changes 
guide that you've rationalized the various AJAX mechanisms so that's why I 
started fiddling with data-rapid. 

br
Paul
 

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/hobousers/-/tQG54vi-I_kJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to