Skip to content
This repository has been archived by the owner on Jul 2, 2018. It is now read-only.

this context in functions #67

Open
bublikOff opened this issue Nov 15, 2012 · 1 comment
Open

this context in functions #67

bublikOff opened this issue Nov 15, 2012 · 1 comment

Comments

@bublikOff
Copy link

In some cases its useful to have link to the owner element, with this patch I can do such things

onNoMatch: function() { $(this).val(''); }

=== PATCH ===

524c524

- return f(data, this);

  •         return f.call(this.dom.$elem, data, this);
    
    561c561

- results = self.options.processData(results);

  •             results = self.options.processData.call(self.dom.$elem, results);
    
    605c605

- self.options.onError(jqXHR, textStatus, errorThrown);

  •                     self.options.onError.call(self.dom.$elem, jqXHR, textStatus, errorThrown);
    
    745c746

- return sortFunction(a, b, filter, self.options);

  •       return sortFunction.call(self.dom.$elem, a, b, filter, self.options);
    
    869c870

    - return this.options.showResult(value, data);

    •         return this.options.showResult.call(this.dom.$elem, value, data);
      
@dyve
Copy link
Owner

dyve commented Feb 2, 2013

Agree, but I think this should always refer to the autocompleter object

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants