I know this question has gone round a couple of times now but the answers don't seem to be exactly what I am looking for. Say I have a plugin called "jdropdown" that looks like:
(function($){
var options = {},
methods = {},
renderItem = function(){},
$.fn.jdropdown = function(method){
// plugin method despatcher
});
})(jQuery);
Now when declaring the plugin I want to allow the user to override the renderItem function in the plugin. I have noticed that jQuery UI gets around this by allowing item access through the data attribute (as can be seem in this example: http://jqueryui.com/demos/autocomplete/#custom-data) but whenever I try and make something like this myself I come to a dead end. I have read the "Data" section of: http://docs.jquery.com/Plugins/Authoring to no avail (They don't really describe how stuff works that well, they just write a lot of 'FTW' and state why it is useful).
Is there anyone who can show me how to use the data attribute of my element (plugin anchor) to access the plugins methods to override them like so:
$('.someThing').jdropdown().data('jdropdown').renderItem = function(){}
Thanks,