Select the following Topics you are interested
Being asked by Jefri Lie a long long time ago for how to use jQuery Table AddRow Plugin together with Jörn Zaefferer's Autocomplete plugin.
jQuery Table AddRow plugin can most of the time friendly to other plugin by suggesting initial code of that plugin inside the btnAddRow() or btnDelRow() method. If you want to use the Jörn Zaefferer's Autocomplete plugin, you have to place the initial code by passing it in btnAddRow() method. The following is a simple demonstration:
Tell the jQuery Table AddRow Plugin what to do by passing the code in the .btnAddRow() method. Please try the following example:
<table><tr><td>
<label>Month (local):</label>
<input type="text" class="month" />
<input class="addRow" type="button" value="Add" />
<input class="delRow" type="button" value="Remove" />
</td></tr></table>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type='text/javascript' src='/js/jquery.autocomplete.js'></script>
<script type="text/javascript" src="/js/jquery.table.addrow.js"></script>
<link rel="stylesheet" type="text/css" href="/css/jquery.autocomplete.css" />
<script type="text/javascript">
var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
(function($){
$(document).ready(function(){
$(".addRow").btnAddRow(function(row){
row.find(".month").autocomplete(months)
});
$(".delRow").btnDelRow();
$(".month").autocomplete(months);
})
})(jQuery);
</script>