Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added method to programatically trigger results #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions auto-complete.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ var autoComplete = (function(){
else
that.sc.style.display = 'none';
}

// Optional method to trigger results programatically
that.triggerSC = function(data){

if (data.length) {
var s = '';
for (var i=0;i<data.length;i++) s += o.renderItem(data[i], '');
that.sc.innerHTML = s;
that.updateSC(0);
}
else
that.sc.style.display = 'none';
};

that.keydownHandler = function(e){
var key = window.event ? e.keyCode : e.which;
Expand Down Expand Up @@ -208,6 +221,8 @@ var autoComplete = (function(){
that = null;
}
};

return elems;
}
return autoComplete;
})();
Expand Down