How to overwrite functions in Struts2 jQuery Plugin
Posted by jogep on 17 Feb 2011 | Tagged as: java, jQuery, Struts jQuery Plugin, struts2
You want to enhance a default handler, fix a bug or just use an other jquery plugin as the default in Struts2 jQuery Plugin?
Here is a short example hot to overwrite the handler function for the autocompleter in Struts2 jQuery Plugin.
<sj:head /> <script type="text/javascript"> $.struts2_jquery.autocompleter = function($elem, options) { alert("my own autocompleter handler for "+options.id); }; </script>
6 Comments »
Twitter
Facebook
Github
Xing
LinkedIn
Hi Johannes,
That’s a good tip.
Could you also suggest as to how i can have the select, blur , change topics working for me while using the Autocompleter handling a List as Select Box.
This is very important requirement for us.
Regards,
1.) Take a look how it currently works. See the autocompleter section around line 1554
http://code.google.com/p/struts2-jquery/source/browse/trunk/struts2-jquery-plugin/src/main/resources/template/js/struts2/jquery.struts2.js
2.) Take a look at the api and demos from jquery UI
http://jqueryui.com/demos/autocomplete/
3.) If you have a common solution for this Issue please create a patch and send it to me.
Hi,
I’m having trouble understanding exactly what this is supposed to be doing. Would I be able to utilize this to disable the default enter/spacebar keypress events for accordions somehow with a variation of this code snippet?
thanks!
Hola como puedo agregra un hiperlink a tree node dinamicamente desde un json
Hello as I can hyperlink to a tree agregra node dynamically from json
This should work since version 3.2.1.
See:
http://code.google.com/p/struts2-jquery/issues/detail?id=729.
Code:
href="%{treeDataUrl}"
nodeHref="%{echo}"
nodeHrefParamName="echo"
nodeTargets="result" />