Monday, January 25, 2010

Re: [jQuery] Combine jquery.jeditable.js with jquery.autocomplete.js

Hi Antonio,


Please try autocomplete from below URL. If you are not able to do that then please let me know

http://www.pengoworks.com/workshop/jquery/autocomplete.htm


Thanks
Sourabh Sharma
www.avideogame.com

On Mon, Jan 25, 2010 at 8:51 PM, Antonio <antonio.pierro@gmail.com> wrote:
Hi,

Someone can suggest me how to write a custom input to
combine "autocomplete" ("http://jquery.bassistance.de/autocomplete/
jquery.autocomplete.js")
functionality with inline editing
of "Jeditable" ("http://www.appelsiini.net/download/
jquery.jeditable.js")?

I want to:
1)set external url to read Json data
2)set dataType = "json"

The option num.1 works, the second no.
how can I pass the parameter "dataType" to "autocomplete library"?

This is my code:
-cut-
$.editable.addInputType('autocomplete', {
        element : $.editable.types.text.element,
        plugin : function(settings, original) {
               $('input', this).autocomplete
(settings.autocomplete.url);
               $('input', this).autocomplete(settings.autocomplete.dataType);
        }
});
-cut-

-cut-
.....
autocomplete : {
               dataType: "json",
               url:    "test.json"
}
....
-cut-

thanks,

Antonio

No comments: