On Martes, 19 de Abril de 2011 08:17:00 Liehann escribió:
> Thanks for the response.
> 
> Draggable lists only works with prototype, I'm using jQuery. I'm
> checking out active_scaffold_sortable which looks like it should do
> the same thing for jQuery.
> 

rails 2.3 version of active scaffold requires prototype. rails3 version work 
with either prototype or jquery, although I'm not sure all features, like 
draggable lists, work with jquery. I haven't used rails3 version very much 
yet.

> The second issue is the default form_ui options displays all items,
> whereas I only want to display those that are associated with the
> specific order, or not yet associated with an order.

Override options_for_association_conditions to search only unassociated items. 
Associated items with that record will be added by ActiveScaffold.

> 
> My current approach is to do a form override method in the
> OrdersHelper. It looks like is should do the trick. I'll update the
> post once I've determined if it works (or not).
> 
>  - L
> 
> On Apr 19, 1:51 am, Michael Latta <[email protected]> wrote:
> > From the documentation on the column API when using form_ui = :select
> > 
> >         • For plural associations:
> >                 • :draggable_lists to show two lists, one with available
> > options and the other with selected options; users select them with drag
> > and drop instead of checkboxes. config.columns[:name].options =
> > {:draggable_lists => true}
> > 
> > Michael
> > 
> > On Apr 18, 2011, at 10:03 AM, Liehann wrote:
> > > Hi,
> > > 
> > > I'd like to customize an association, but on the has_many side.
> > > 
> > > For example we have orders and items. An order has many items, an item
> > > may belong to an order.
> > > 
> > > class Order
> > >  has_many :items
> > > end
> > > 
> > > class Item
> > >  belongs_to :order
> > > end
> > > 
> > > When adding / editing an order I'd like to display two lists - the
> > > left one shows the items associated with the order, the right the
> > > items not associated with any order.
> > > 
> > > if I do "config.columns[:items].form_ui = :select" I get a check box
> > > for each item - not quite what I want. Any suggestions on how to
> > > customize the behavior?
> > > 
> > > - Liehann
> > > 
> > > --
> > > You received this message because you are subscribed to the Google
> > > Groups "ActiveScaffold : Ruby on Rails plugin" group. 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 athttp://groups.google.com/group/activescaffold?hl=en.

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
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/activescaffold?hl=en.

Reply via email to