plugin_lazy_options_widget trigger event

48 views
Skip to first unread message

Jim Steil

unread,
May 15, 2012, 3:46:20 PM5/15/12
to web...@googlegroups.com
Hi

I'm trying to use the plugin_lazy_options_widget to build a dependent
select list. I have to fields on the screen, both with the IS_IN_DB
validator and values available in the second depend on what is selected
in the first. This widget from s-cubism seems like just the thing, but
I can't figure out how to pass the right event that will trigger the
population of the second widget.

The example shows it working with another widget from s-cubism which
triggers an event on the 'body' element but I can't see how to trigger
the right event to get mien working off another SELECT element.

Can someone give me some pointers on how to determine the event to watch
for?

-Jim


kenji4569

unread,
May 16, 2012, 8:30:05 PM5/16/12
to web...@googlegroups.com
Hi Jim,

In puling_suggest_widget, trigger events are invoked from a js file:
https://github.com/sqlabs/sqlabs/blob/master/static/plugin_suggest_widget/suggest.js
by
$input.trigger($input.attr('id') + '__unselected');
$input.trigger($input.attr('id') + '__selected', [val]);
methods.
To setup your trigger events, first you need to create a custom widget for a field, and then trigger events inside the widget using the jQuery trigger method.

Regards,
Kenji

2012年5月16日水曜日 4時46分20秒 UTC+9 Jim S:

Richard Vézina

unread,
May 17, 2012, 10:22:50 AM5/17/12
to web...@googlegroups.com
What to do to not have dependency, I don't like to have autocomplete, but in the pass I didn't find how to avoid of using Suggest Widget.

Thanks

Richard

Jim Steil

unread,
May 17, 2012, 10:26:09 AM5/17/12
to web...@googlegroups.com
Thanks Kenji - I was trying to do this with the default widgets provided by web2py.  Thanks for the info though, I will go down this path when I get the time to dig deeper.

    -Jim
Reply all
Reply to author
Forward
0 new messages