Closed shadowhand closed 13 years ago
To hack around resetting the form as in the above example, I had to rename jQuery.fn.quicksearch.trigger
to jQuery.fn.quicksearch.activate
.
Closed this by mistake... please reopen and delete this comment.
This is intentional so that users can have access to internal functions, see the Ajax example on the documentation to see how it's used
My use case still stands. Once you apply quicksearch to an input, you can no longer use the jQuery.trigger method. A plugin should not overwrite existing methods. There are many ways to provide access to internal functions without polluting the jQuery namespace.
From the docs:
Under no circumstance should a single plugin ever claim more than one namespace in the jQuery.fn object.
Right now it is impossible to do this:
and have the search form reset, showing all rows.
The problem lies in the way that quicksearch uses
this
, which in the context of a plugin, refers to the matched element, not the$.fn.quicksearch
class. To correct this, either use$.fn.quicksearch.func
instead ofthis.func
or simplyfunc
and disallow outside access.