6 "desc" : "Create a \"View\" for an element based on a data model or UpdateManager and the supplied DomHelper template. \nThis class also supports single and multi selection modes. <br>\nCreate a data model bound view:\n <pre><code>\n var store = new Roo.data.Store(...);\n\n var view = new Roo.View({\n el : \"my-element\",\n tpl : '<div id=\"{0}\">{2} - {1}</div>', // auto create template\n \n singleSelect: true,\n selectedClass: \"ydataview-selected\",\n store: store\n });\n\n // listen for node click?\n view.on(\"click\", function(vw, index, node, e){\n alert('Node \"' + node.id + '\" at index: ' + index + \" was clicked.\");\n });\n\n // load XML data\n dataModel.load(\"foobar.xml\");\n </code></pre>\n For an example of creating a JSON/UpdateManager view, see {@link Roo.JsonView}.\n<br><br>\n<b>Note: The root of your template must be a single node. Table/row implementations may work but are not supported due to\nIE\"s limited insertion support with tables and Opera\"s faulty event bubbling.</b>\n\nNote: old style constructor is still suported (container, template, config)",
19 "desc" : "The config object",
27 "name" : "selectedClass",
29 "desc" : "The css class to add to selected nodes",
30 "memberOf" : "Roo.View",
37 "desc" : "list of events and functions to call for this object, \nFor example :\n<pre><code>\n listeners : { \n 'click' : function(e) {\n ..... \n } ,\n .... \n } \n </code></pre>",
38 "memberOf" : "Roo.util.Observable",
45 "desc" : "the named area of the template to use as the data area\n Works with domtemplates roo-name=\"name\"",
46 "memberOf" : "Roo.View",
53 "desc" : "to display on mask (default Loading)",
54 "memberOf" : "Roo.View",
59 "name" : "multiSelect",
61 "desc" : "Allow multiple selection",
62 "memberOf" : "Roo.View",
69 "desc" : "The empty text to show when nothing is loaded.",
70 "memberOf" : "Roo.View",
76 "type" : "Roo.data.Store",
77 "desc" : "Data store to load data from.",
78 "memberOf" : "Roo.View",
83 "name" : "toggleSelect",
85 "desc" : "- selecting",
86 "memberOf" : "Roo.View",
91 "name" : "singleSelect",
93 "desc" : "Allow single selection",
94 "memberOf" : "Roo.View",
101 "desc" : "- selecting",
102 "memberOf" : "Roo.View",
108 "type" : "String|Roo.Element",
109 "desc" : "The container element.",
110 "memberOf" : "Roo.View",
116 "type" : "String|Roo.Template",
117 "desc" : "The template used by this View",
118 "memberOf" : "Roo.View",
125 "name" : "getSelectedNodes",
126 "desc" : "Get the currently selected nodes.",
128 "isConstructor" : false,
130 "memberOf" : "Roo.View",
141 "desc" : "An array of HTMLElements"
147 "desc" : "Gets a range template nodes.",
149 "isConstructor" : false,
151 "memberOf" : "Roo.View",
158 "name" : "startIndex",
174 "desc" : "An array of nodes"
180 "desc" : "Selects nodes.",
182 "isConstructor" : false,
184 "memberOf" : "Roo.View",
192 "type" : "Array/HTMLElement/String/Number",
193 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
197 "name" : "keepExisting",
199 "desc" : "(optional) true to keep existing selections",
203 "name" : "suppressEvent",
205 "desc" : "(optional) true to skip firing of the selectionchange vent",
213 "name" : "clearSelections",
214 "desc" : "Clear all selections",
216 "isConstructor" : false,
218 "memberOf" : "Roo.View",
225 "name" : "suppressEvent",
227 "desc" : "(optional) true to skip firing of the selectionchange event",
235 "name" : "isSelected",
236 "desc" : "Returns true if the passed node is selected",
238 "isConstructor" : false,
240 "memberOf" : "Roo.View",
248 "type" : "HTMLElement/Number",
249 "desc" : "The node or node index",
263 "desc" : "Refreshes the view. - called by datachanged on the store. - do not call directly.",
265 "isConstructor" : false,
267 "memberOf" : "Roo.View",
278 "name" : "onBeforeLoad",
279 "desc" : "onbeforeLoad - masks the loading area.",
281 "isConstructor" : false,
283 "memberOf" : "Roo.View",
294 "name" : "getSelectedIndexes",
295 "desc" : "Get the indexes of the selected nodes.",
297 "isConstructor" : false,
299 "memberOf" : "Roo.View",
316 "desc" : "Finds the index of the passed node",
318 "isConstructor" : false,
320 "memberOf" : "Roo.View",
328 "type" : "HTMLElement/String/Number",
329 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
337 "desc" : "The index of the node or -1"
343 "desc" : "Returns the element this view is bound to.",
345 "isConstructor" : false,
347 "memberOf" : "Roo.View",
357 "type" : "Roo.Element",
364 "desc" : "Changes the data store this view uses and refresh the view.",
366 "isConstructor" : false,
368 "memberOf" : "Roo.View",
385 "name" : "refreshNode",
386 "desc" : "Refresh an individual node.",
388 "isConstructor" : false,
390 "memberOf" : "Roo.View",
407 "name" : "prepareData",
408 "desc" : "Function to override to reformat the data that is sent to\nthe template for each node.\nDEPRICATED - use the preparedata event handler.",
410 "isConstructor" : false,
412 "memberOf" : "Roo.View",
420 "type" : "Array/Object",
421 "desc" : "The raw data (array of colData for a data model bound view or\na JSON object for an UpdateManager bound view).",
429 "name" : "getSelectionCount",
430 "desc" : "Get the number of selected nodes.",
432 "isConstructor" : false,
434 "memberOf" : "Roo.View",
450 "name" : "findItemFromChild",
451 "desc" : "Returns the template node the passed child belongs to or null if it doesn't belong to one.",
453 "isConstructor" : false,
455 "memberOf" : "Roo.View",
463 "type" : "HTMLElement",
471 "type" : "HTMLElement",
472 "desc" : "The template node"
478 "desc" : "Unselects nodes.",
480 "isConstructor" : false,
482 "memberOf" : "Roo.View",
490 "type" : "Array/HTMLElement/String/Number",
491 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
495 "name" : "keepExisting",
497 "desc" : "(optional) true IGNORED (for campatibility with select)",
501 "name" : "suppressEvent",
503 "desc" : "(optional) true to skip firing of the selectionchange vent",
512 "desc" : "Gets a template node.",
514 "isConstructor" : false,
516 "memberOf" : "Roo.View",
524 "type" : "HTMLElement/String/Number",
525 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
532 "type" : "HTMLElement",
533 "desc" : "The node or null if it wasn't found"
538 "name" : "purgeListeners",
539 "desc" : "Removes all listeners for this object",
541 "isConstructor" : false,
543 "memberOf" : "Roo.util.Observable",
555 "desc" : "Appends an event handler to this element (shorthand for addListener)",
557 "isConstructor" : false,
559 "memberOf" : "Roo.util.Observable",
566 "name" : "eventName",
568 "desc" : "The type of event to listen for",
574 "desc" : "The method the event invokes",
580 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
586 "desc" : "(optional)",
595 "desc" : "Removes a listener (shorthand for removeListener)",
597 "isConstructor" : false,
599 "memberOf" : "Roo.util.Observable",
606 "name" : "eventName",
608 "desc" : "The type of event to listen for",
614 "desc" : "The handler to remove",
620 "desc" : "(optional) The scope (this object) for the handler",
628 "name" : "addEvents",
629 "desc" : "Used to define events on this Observable",
631 "isConstructor" : false,
633 "memberOf" : "Roo.util.Observable",
642 "desc" : "The object with the events defined",
650 "name" : "releaseCapture",
651 "desc" : "Removes <b>all</b> added captures from the Observable.",
653 "isConstructor" : false,
655 "memberOf" : "Roo.util.Observable",
663 "type" : "Observable",
664 "desc" : "The Observable to release",
672 "name" : "removeListener",
673 "desc" : "Removes a listener",
675 "isConstructor" : false,
677 "memberOf" : "Roo.util.Observable",
684 "name" : "eventName",
686 "desc" : "The type of event to listen for",
692 "desc" : "The handler to remove",
698 "desc" : "(optional) The scope (this object) for the handler",
706 "name" : "fireEvent",
707 "desc" : "Fires the specified event with the passed parameters (minus the event name).",
709 "isConstructor" : false,
711 "memberOf" : "Roo.util.Observable",
718 "name" : "eventName",
725 "type" : "Object...",
726 "desc" : "Variable number of parameters are passed to handlers",
734 "desc" : "returns false if any of the handlers return false otherwise it returns true"
739 "name" : "hasListener",
740 "desc" : "Checks to see if this object has any listeners for a specified event",
742 "isConstructor" : false,
744 "memberOf" : "Roo.util.Observable",
751 "name" : "eventName",
753 "desc" : "The name of the event to check for",
761 "desc" : "True if the event is being listened for, else false"
767 "desc" : "Starts capture on the specified Observable. All events will be passed\nto the supplied function with the event name + standard signature of the event\n<b>before</b> the event is fired. If the supplied function returns false,\nthe event will not fire.",
769 "isConstructor" : false,
771 "memberOf" : "Roo.util.Observable",
779 "type" : "Observable",
780 "desc" : "The Observable to capture",
786 "desc" : "The function to call",
792 "desc" : "(optional) The scope (this object) for the fn",
800 "name" : "addListener",
801 "desc" : "Appends an event handler to this component",
803 "isConstructor" : false,
805 "memberOf" : "Roo.util.Observable",
812 "name" : "eventName",
814 "desc" : "The type of event to listen for",
820 "desc" : "The method the event invokes",
826 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
832 "desc" : "(optional) An object containing handler configuration\nproperties. This may contain any of the following properties:<ul>\n<li>scope {Object} The scope in which to execute the handler function. The handler function's \"this\" context.</li>\n<li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li>\n<li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li>\n<li>buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed\nby the specified number of milliseconds. If the event fires again within that time, the original\nhandler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>\n</ul><br>\n<p>\n<b>Combining Options</b><br>\nUsing the options argument, it is possible to combine different types of listeners:<br>\n<br>\nA normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)\n\t\t<pre><code>\n\t\tel.on('click', this.onClick, this, {\n \t\t\tsingle: true,\n \t\tdelay: 100,\n \t\tforumId: 4\n\t\t});\n\t\t</code></pre>\n<p>\n<b>Attaching multiple handlers in 1 call</b><br>\nThe method also allows for a single argument to be passed which is a config object containing properties\nwhich specify multiple handlers.\n<pre><code>\n\t\tel.on({\n\t\t\t'click': {\n \t\tfn: this.onClick,\n \t\tscope: this,\n \t\tdelay: 100\n \t\t}, \n \t\t'mouseover': {\n \t\tfn: this.onMouseOver,\n \t\tscope: this\n \t\t},\n \t\t'mouseout': {\n \t\tfn: this.onMouseOut,\n \t\tscope: this\n \t\t}\n\t\t});\n\t\t</code></pre>\n<p>\nOr a shorthand syntax which passes the same scope object to all handlers:\n \t<pre><code>\n\t\tel.on({\n\t\t\t'click': this.onClick,\n \t\t'mouseover': this.onMouseOver,\n \t\t'mouseout': this.onMouseOut,\n \t\tscope: this\n\t\t});\n\t\t</code></pre>",
843 "desc" : "Fires when a template node is double clicked.",
844 "memberOf" : "Roo.View",
859 "desc" : "The index of the target node",
864 "type" : "HTMLElement",
865 "desc" : "The target node",
870 "type" : "Roo.EventObject",
871 "desc" : "The raw event object",
879 "name" : "preparedata",
880 "desc" : "Fires on every row to render, to allow you to change the data.",
881 "memberOf" : "Roo.View",
896 "desc" : "to be rendered (change this)",
904 "name" : "selectionchange",
905 "desc" : "Fires when the selected nodes change.",
906 "memberOf" : "Roo.View",
919 "name" : "selections",
921 "desc" : "Array of the selected nodes",
929 "name" : "beforeselect",
930 "desc" : "Fires before a selection is made. If any handlers return false, the selection is cancelled.",
931 "memberOf" : "Roo.View",
945 "type" : "HTMLElement",
946 "desc" : "The node to be selected",
950 "name" : "selections",
952 "desc" : "Array of currently selected nodes",
960 "name" : "beforeclick",
961 "desc" : "Fires before a click is processed. Returns false to cancel the default action.",
962 "memberOf" : "Roo.View",
977 "desc" : "The index of the target node",
982 "type" : "HTMLElement",
983 "desc" : "The target node",
988 "type" : "Roo.EventObject",
989 "desc" : "The raw event object",
998 "desc" : "Fires when a template node is clicked.",
999 "memberOf" : "Roo.View",
1007 "type" : "Roo.View",
1009 "isOptional" : false
1014 "desc" : "The index of the target node",
1015 "isOptional" : false
1019 "type" : "HTMLElement",
1020 "desc" : "The target node",
1021 "isOptional" : false
1025 "type" : "Roo.EventObject",
1026 "desc" : "The raw event object",
1027 "isOptional" : false
1034 "name" : "contextmenu",
1035 "desc" : "Fires when a template node is right clicked.",
1036 "memberOf" : "Roo.View",
1044 "type" : "Roo.View",
1046 "isOptional" : false
1051 "desc" : "The index of the target node",
1052 "isOptional" : false
1056 "type" : "HTMLElement",
1057 "desc" : "The target node",
1058 "isOptional" : false
1062 "type" : "Roo.EventObject",
1063 "desc" : "The raw event object",
1064 "isOptional" : false