You can also add / force an event to control the process. For example, I have one place where I add and autofill the added item. This way I control the "change" event (inside the .change () function):
$(this).change(); // fire change event (to be used in other user controls)
Then I call the function inside the change event handler for a specific element that has autocomplete in it to add it to that element. There are other ways, my circumstance. I do this manually because I am manipulating a complex new addition, not just a table row.
function myAddAuto() { $(".cptEntryArea").autocomplete("mywebservice/myService.asmx/GetMyAutocomplete", { dataType: 'json', data: {}, type: "POST", contentType: "application/json; charset=utf-8", parse: function(data) { return myAutocompleteJSONParse(data); }, maxRows: 100, formatItem: function(row) { return row["Description"] + ' (' + row["MyCode"] + ')' }, minChars: 2, matchSubset: false, scrollHeight: 100, width: 300 }); };
There are other ways, but the basic premise is the same - add handlers to the newly added object in the row that you add to the table.
Mark schultheiss
source share