/* Copyright (c) 2004-2006, The Dojo Foundation All Rights Reserved. Licensed under the Academic Free License version 2.1 or above OR the modified BSD license. For more information on Dojo licensing, see: http://dojotoolkit.org/community/licensing.shtml */ dojo.provide("dojo.widget.Repeater"); dojo.require("dojo.widget.HtmlWidget"); dojo.require("dojo.string"); dojo.require("dojo.event.*"); dojo.require("dojo.experimental"); dojo.experimental("dojo.widget.Repeater"); dojo.widget.defineWidget("dojo.widget.Repeater", dojo.widget.HtmlWidget, { /* summary: Makes it easy to add dynamicly new segments to form, ie. add new rows. description: usage:
Name:
Name:
", {doThis: function(node) { dojo.event.connect(node,"onClick", function() { alert("HERE"); }); } ); */ name: "", rowTemplate: "", // myObject: // Used to bind functionality to rowFunctions myObject: null, // myObject: // defines pattern of the names pattern: "", // useDnd: // if true, you can change position of rows by DnD // you can also remove rows by dragging row away useDnd: false, isContainer: true, initialize: function(args,frag) { var node = this.getFragNodeRef(frag); node.removeAttribute("dojotype"); this.setRow(dojo.string.trim(node.innerHTML), {}); node.innerHTML=""; frag=null; }, postCreate: function(args,frag){ if (this.useDnd) { dojo.require("dojo.dnd.*"); var dnd = new dojo.dnd.HtmlDropTarget(this.domNode, [this.widgetId]); } }, _reIndexRows: function() { for(var i=0,len=this.domNode.childNodes.length; i