I have a slick grid data columns and one field has a country autocomplete in the editor type field. Here is the grid set up
var columns =[ { id: "CountryOfOrigin", name: "Country Of Mfg.", field: "CountryOfOrigin", minWidth: 120, editor: Slick.Editors.Auto }, ];
There are also other fields left out of code listing for brevity. I changed my SlickGridEditor.js to incorporate the country autocomplete source table as follows
var availableTags = ["Afghanistan", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", ];
And I changed the AutoCompleteEditor function in the SlickGridEditor.js as follows
function AutoCompleteEditor(args) {
var $input;
var defaultValue;
var scope = this;
var calendarOpen = false;
this.init = function () {
$input = $("<INPUT id='tags' class='editor-text' />");
$input.appendTo(args.container);
$input.focus().select();
$input.bind("keydown.nav", function (e) {
if ((e.keyCode == $.ui.keyCode.DOWN || e.keyCode == $.ui.keyCode.UP ||
e.keyCode == $.ui.keyCode.ENTER)
&& $('ul.ui-autocomplete').is(':visible')) e.stopPropagation();
if (e.keyCode == $.ui.keyCode.LEFT || e.keyCode == $.ui.keyCode.RIGHT)
e.stopImmediatePropagation();
});
minLength: 3,
$input.autocomplete({
source: availableTags
});
};
this.destroy = function () {
$input.autocomplete("destroy");
};
this.focus = function () {
$input.focus();
};
Now I need to add autocomplete to another field in the grid named region that has a list of regions I want autocompleted like Africa, Asia, Central America,Eastern Europe,European Union,Middle East,North America, Oceania, South America, The Caribbean
Can I deploy multiple autocompletes on the same grid and how would I do that? Thanks so much in advance.