In my plugins for working with select boxes, ajaxAddOption can now call a function after the options have been added. There is also a new plugin (containsOption) for checking if an option with a given value exists.
<code>
void csharp {}
<?php echo ?>
SELECT code FROM SQL
<asp:net runat="server" />
function javascript() {}
$(jquery)
</code>
<tools>
<freeware /><opensource />
</tools>
In my plugins for working with select boxes, ajaxAddOption can now call a function after the options have been added. There is also a new plugin (containsOption) for checking if an option with a given value exists.

This work is licenced under a Creative Commons Licence.
3 comments:
just tested the update to the plugin for large amount of ptions when using ajaxAddOption and it works very well. great job with this. keep up the good work.
OK, but how do you use the new fn argument to access the select list? Specifically to call the sortOptions method from the same plugin library.
I've tried function(){this.sortOptions()} as well as function(){arguments[0].sortOptions()}, but neither work. In fact, I don't see any arguments being passed in to the specified function.
I finally figured it out, but your documentation for that function is wrong. The example shows that you pass a hash, but it should be an array. Here's what finally worked:
var s = $(this).parent().next().find("select");
s.removeOption(/./);
s.ajaxAddOption("/project/contacts", {'id': this.value, 'type': 'onsite', 'info': 'full_name_with_address'}, false, function(){arguments[0].sortOptions()}, [s]);
Post a Comment