Luke Lutman schrieb:
> Jörn Zaefferer wrote:
>   
>> I definitely agree on standardising the options/defaults pattern.
>>
>> But I'm not so sure if we really need the pluginOptions method. As
>> soon as you can pass around data via event binding, the need for
>> binding data directly to elements should be gone.
>>
>> Do you have other examples where that pluginOptions method could be
>> useful?
>>     
>
> I'm a bit confused ... it seems like there are two trains of thought here.
>
> The first, Mark's suggestion, is about having an accessible (outside of 
> the plugin itself) set of default options that could be extended with 
> another set of options when the plugin method is called. These settings 
> are for the plugin itself, not any elements it's working with.
>   
Yeah. Actually we settled that discussion, because the pattern is pretty 
clear.
> The second is about storing options for a particular dom element to be 
> reused later. I don't have much experience in this area, I don't think 
> the ideas above conflict with passing data via event binding (with 
> closures, I imagine?).
>   
There are cases where you can't rely on closures, or don't want to. In 
those, you have to bind data to dom elements to access them later. Mark 
suggestion was to encapsulate that binding via a special method or 
function. But as you need that binding (to my experience) only when 
working with events, allowing data binding via events should solve the 
problem.

-- 
Jörn Zaefferer

http://bassistance.de


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to