Permalink
Browse files

Bugfix: When using a function as datasource the isNew funtion gives a…

…n error. fixed
  • Loading branch information...
1 parent e049dcc commit aa287b15d5cb5dcd8ff383be95918cfb09157ed7 @webworka committed Jun 8, 2011
Showing with 3 additions and 4 deletions.
  1. +1 −3 js/jquery.tagedit-1.1.0.js
  2. +2 −1 playground.html
@@ -405,9 +405,7 @@
result = options.autocompleteOptions.source;
}
else if ($.isFunction(options.autocompleteOptions.source)) {
- result = options.autocompleteOptions.source.apply({
- term: value
- });
+ options.autocompleteOptions.source({term: value}, function (data) {result = data});
}
else if (typeof options.autocompleteOptions.source === "string") {
// Check also autocomplete values
View
@@ -65,7 +65,8 @@
var data = [
{ "id": "1", "label": "Hazel Grouse", "value": "Hazel Grouse" },
{ "id": "2", "label": "Common Quail", "value": "Common Quail" },
- { "id": "3", "label": "Greylag Goose", "value": "Greylag Goose" }
+ { "id": "3", "label": "Greylag Goose", "value": "Greylag Goose" },
+ { "id": "4", "label": "Merlin", "value": "Merlin" },
];
return response($.ui.autocomplete.filter(data, request.term) );
}

0 comments on commit aa287b1

Please sign in to comment.