[TW2] jquery TabsWidget

9 views
Skip to first unread message

Robert Sudwarts

unread,
Nov 3, 2010, 11:49:06 AM11/3/10
to toscawidge...@googlegroups.com
Hi,

I'm have real difficulty understanding (strike that, complete failure to understand!) how to add a tab using an href (ajax etc).

I have a standalone form working with a tab picking up its data from a url however I fail to see how this can be implemented using the TW widget. Clearly, using the 'items' parameter it will only accept 'tab label' & 'text',  so I'm making an assumption that this can be done in some  way using options : { 'add' : {} } .... ??

I'd be very grateful if someone could share some example code to show me how this can be accomplished.

Many thanks,
Rob  

Ralph Bean

unread,
Nov 3, 2010, 8:57:58 PM11/3/10
to toscawidge...@googlegroups.com
Hello Rob,

You're right! There was no way to do it. D'oh.

I just committed a patch that allows it:
https://github.com/ralphbean/tw2.jquery.plugins.ui/commit/5a779ad68495d574bae353bffd291894f1041bf8

A usage sample can be found at the end of this file:
https://github.com/ralphbean/tw2.jquery.plugins.ui/blob/master/tw2/jquery/plugins/ui/samples.py

The demo site has also been updated (its at the very bottom):
http://craftsman.rc.rit.edu/module?module=tw2.jquery.plugins.ui

The widget is now expecting its `items` parameter to be a list of
dicts (in which you can specify an 'href' value) but it's also
backwards compatible and will convert old-style lists-of-tuples to
lists-of-dicts.

Cheers-
-Ralph

> --
> You received this message because you are subscribed to the Google Groups "ToscaWidgets-discuss" group.
> To post to this group, send email to toscawidge...@googlegroups.com.
> To unsubscribe from this group, send email to toscawidgets-dis...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/toscawidgets-discuss?hl=en.
>

Robert Sudwarts

unread,
Nov 4, 2010, 5:38:38 AM11/4/10
to toscawidge...@googlegroups.com
Ralph,

Thank you *so* much ... that looks to be working perfectly.  So, far I've had a look at this via the TW2 browser (all good) and will try to implement this with my code later today.

Once again, thank you!!

Regards,
Rob

PS  the webob response ... neat trick!!  :)
Reply all
Reply to author
Forward
0 new messages