Skip to content

Override Ajax requests with custom method#356

Closed
recallfx wants to merge 1 commit into
twitter:masterfrom
recallfx:ajax-override
Closed

Override Ajax requests with custom method#356
recallfx wants to merge 1 commit into
twitter:masterfrom
recallfx:ajax-override

Conversation

@recallfx
Copy link
Copy Markdown

Override Ajax requests with custom method still using all of transport functionality.

This is different approach to issues #95, #206 and #232, than in pull request #220.

Basically we are replacing $.ajax(url).done(done) with this.override(url, done), this way we still have caching and request threshold.

Usage could be as simple as this:

      $('.override').typeahead({
        remote : {
          url : '%QUERY',
          override : function(query, done){
            setTimeout(function() {
              done(['one', 'two', 'three']);
            }, 500);
          }
        }
      });

Note, that query is encoded, so url must be the same as wildcard;

Override Ajax requests with custom method still using all of transport
functionality.
@jharding
Copy link
Copy Markdown
Contributor

Appreciate the pull request, but I've actually already implemented something similar in the integration-0.10.0 branch.

@jharding jharding closed this Jul 22, 2013
@divadrei
Copy link
Copy Markdown

could you explain what you got in mind in branch integration-0.10.0 and/or simply give a commit # ?

@acemtp
Copy link
Copy Markdown

acemtp commented Sep 6, 2013

I still need a "source" way to feed the values with a function instead of a static array or a ajax request.
I don't find in the branch integration-0.10.0 where the code is to do that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants