Hi,

Can someone provide a hint on how to implement a sortable table-plus
that can be refreshed through ajax?

Thanks,
  Tiago Franco

GamaFranco wrote:
> Hello,
>
> I'm having trouble implementing the sortable rows on table-plus.
>
> The following table-plus is refreshed whenever a new member is added,
> but can not be sorted (at least I don't know how to implement the
> controller).
>
> <table-plus:memberships fields="user, score" part="members"/>
>
> <form:memberships.new update="games, members" reset-form refocus-form>
>   Add a member:<name-one:user complete-target="&@championship"
> completer="new_member_name"/>
> </form>
>
>
> Changing the memberships to an instance variable allows the controller
> to process the sort order, but throws an exception whenever a member
> is added.
>
> The view:
>
> <table-plus with="&@memberships" fields="user, score" part="members"/>
>
> <form:memberships.new update="games, members" reset-form refocus-form>
>   Add a member:<name-one:user complete-target="&@championship"
> completer="new_member_name"/>
> </form>
>
> The controller:
>
> def show
>     @championship = find_instance
>     @memberships = @championship.memberships.apply_scopes(:order_by
> => parse_sort_param(:score))
> end
>
> Unfortunately whenever the user adds a new member, the ajax call can
> not refresh the table because @memberships is nil.
>
> What's the correct way to implement this?
>
> Thanks,
>   Tiago Franco
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Hobo 
Users" 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/hobousers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to