隆鎮,Patent News,Hacker News Twitter,Network security,Freelance Web Designer
Daily Examplet

jQuery Examplets and Examples

Select the following Topics you are interested

  1. Caret Plugin
  2. Format Plugin
  3. Table AddRow Plugin
  4. Truncator Plugin
  5. TrapKey Plugin
  6. Regular Expression plugin / Selector (regex)
  7. Output Plugin
  8. Loader Plugin
  9. Matt Glass Plugin
  10. Lens Plugin
  11. ClippedImage Plugin
  12. DefaultText Plugin
  13. Simple Tree-node
  14. Simple Tree-set
  15. Simple zoomGlass

Using jQuery Table AddRow Plugin with Autocomplete plugin

Description

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:

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>

 


Copyright 2012 Cloudgen,
find Cloudgen in:linkedin