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",
28 "name" : "selectedClass",
30 "desc" : "The css class to add to selected nodes",
36 "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>",
37 "memberOf" : "Roo.util.Observable"
42 "desc" : "the named area of the template to use as the data area\n Works with domtemplates roo-name=\"name\"",
48 "desc" : "to display on mask (default Loading)",
52 "name" : "multiSelect",
54 "desc" : "Allow multiple selection",
60 "desc" : "The empty text to show when nothing is loaded.",
65 "type" : "Roo.data.Store",
66 "desc" : "Data store to load data from.",
70 "name" : "toggleSelect",
72 "desc" : "- selecting",
76 "name" : "singleSelect",
78 "desc" : "Allow single selection",
84 "desc" : "- selecting",
89 "type" : "String|Roo.Element",
90 "desc" : "The container element.",
95 "type" : "String|Roo.Template",
96 "desc" : "The template used by this View",
102 "name" : "getSelectedNodes",
104 "desc" : "Get the currently selected nodes.",
105 "sig" : "()\n{\n\n}",
109 "isConstructor" : false,
122 "desc" : "An array of HTMLElements"
129 "desc" : "Gets a range template nodes.",
130 "sig" : "(startIndex, endIndex)",
134 "isConstructor" : false,
144 "name" : "startIndex",
160 "desc" : "An array of nodes"
167 "desc" : "Selects nodes.",
168 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
172 "isConstructor" : false,
183 "type" : "Array/HTMLElement/String/Number",
184 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
188 "name" : "keepExisting",
190 "desc" : "(optional) true to keep existing selections",
194 "name" : "suppressEvent",
196 "desc" : "(optional) true to skip firing of the selectionchange vent",
203 "name" : "clearSelections",
205 "desc" : "Clear all selections",
206 "sig" : "(suppressEvent)",
210 "isConstructor" : false,
220 "name" : "suppressEvent",
222 "desc" : "(optional) true to skip firing of the selectionchange event",
229 "name" : "isSelected",
231 "desc" : "Returns true if the passed node is selected",
236 "isConstructor" : false,
247 "type" : "HTMLElement/Number",
248 "desc" : "The node or node index",
263 "desc" : "Refreshes the view. - called by datachanged on the store. - do not call directly.",
264 "sig" : "()\n{\n\n}",
268 "isConstructor" : false,
280 "name" : "onBeforeLoad",
282 "desc" : "onbeforeLoad - masks the loading area.",
283 "sig" : "()\n{\n\n}",
287 "isConstructor" : false,
299 "name" : "getSelectedIndexes",
301 "desc" : "Get the indexes of the selected nodes.",
302 "sig" : "()\n{\n\n}",
306 "isConstructor" : false,
326 "desc" : "Finds the index of the passed node",
327 "sig" : "(nodeInfo)",
331 "isConstructor" : false,
342 "type" : "HTMLElement/String/Number",
343 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
351 "desc" : "The index of the node or -1"
358 "desc" : "Returns the element this view is bound to.",
359 "sig" : "()\n{\n\n}",
363 "isConstructor" : false,
375 "type" : "Roo.Element",
383 "desc" : "Changes the data store this view uses and refresh the view.",
388 "isConstructor" : false,
407 "name" : "refreshNode",
409 "desc" : "Refresh an individual node.",
414 "isConstructor" : false,
433 "name" : "prepareData",
435 "desc" : "Function to override to reformat the data that is sent to\nthe template for each node.\nDEPRICATED - use the preparedata event handler.",
440 "isConstructor" : false,
451 "type" : "Array/Object",
452 "desc" : "The raw data (array of colData for a data model bound view or\na JSON object for an UpdateManager bound view).",
459 "name" : "getSelectionCount",
461 "desc" : "Get the number of selected nodes.",
462 "sig" : "()\n{\n\n}",
466 "isConstructor" : false,
484 "name" : "findItemFromChild",
486 "desc" : "Returns the template node the passed child belongs to or null if it doesn't belong to one.",
491 "isConstructor" : false,
502 "type" : "HTMLElement",
510 "type" : "HTMLElement",
511 "desc" : "The template node"
518 "desc" : "Unselects nodes.",
519 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
523 "isConstructor" : false,
534 "type" : "Array/HTMLElement/String/Number",
535 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
539 "name" : "keepExisting",
541 "desc" : "(optional) true IGNORED (for campatibility with select)",
545 "name" : "suppressEvent",
547 "desc" : "(optional) true to skip firing of the selectionchange vent",
556 "desc" : "Gets a template node.",
557 "sig" : "(nodeInfo)",
561 "isConstructor" : false,
572 "type" : "HTMLElement/String/Number",
573 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
580 "type" : "HTMLElement",
581 "desc" : "The node or null if it wasn't found"
586 "name" : "purgeListeners",
588 "desc" : "Removes all listeners for this object",
589 "sig" : "()\n{\n\n}",
591 "memberOf" : "Roo.util.Observable",
593 "isConstructor" : false,
607 "desc" : "Appends an event handler to this element (shorthand for addListener)",
608 "sig" : "(eventName, handler, scope, options)",
610 "memberOf" : "Roo.util.Observable",
612 "isConstructor" : false,
622 "name" : "eventName",
624 "desc" : "The type of event to listen for",
630 "desc" : "The method the event invokes",
636 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
642 "desc" : "(optional)",
651 "desc" : "Removes a listener (shorthand for removeListener)",
652 "sig" : "(eventName, handler, scope)",
654 "memberOf" : "Roo.util.Observable",
656 "isConstructor" : false,
666 "name" : "eventName",
668 "desc" : "The type of event to listen for",
674 "desc" : "The handler to remove",
680 "desc" : "(optional) The scope (this object) for the handler",
687 "name" : "addEvents",
689 "desc" : "Used to define events on this Observable",
692 "memberOf" : "Roo.util.Observable",
694 "isConstructor" : false,
706 "desc" : "The object with the events defined",
713 "name" : "releaseCapture",
715 "desc" : "Removes <b>all</b> added captures from the Observable.",
718 "memberOf" : "Roo.util.Observable",
720 "isConstructor" : false,
731 "type" : "Observable",
732 "desc" : "The Observable to release",
739 "name" : "removeListener",
741 "desc" : "Removes a listener",
742 "sig" : "(eventName, handler, scope)",
744 "memberOf" : "Roo.util.Observable",
746 "isConstructor" : false,
756 "name" : "eventName",
758 "desc" : "The type of event to listen for",
764 "desc" : "The handler to remove",
770 "desc" : "(optional) The scope (this object) for the handler",
777 "name" : "fireEvent",
779 "desc" : "Fires the specified event with the passed parameters (minus the event name).",
780 "sig" : "(eventName, args)",
782 "memberOf" : "Roo.util.Observable",
784 "isConstructor" : false,
794 "name" : "eventName",
801 "type" : "Object...",
802 "desc" : "Variable number of parameters are passed to handlers",
810 "desc" : "returns false if any of the handlers return false otherwise it returns true"
815 "name" : "hasListener",
817 "desc" : "Checks to see if this object has any listeners for a specified event",
818 "sig" : "(eventName)",
820 "memberOf" : "Roo.util.Observable",
822 "isConstructor" : false,
832 "name" : "eventName",
834 "desc" : "The name of the event to check for",
842 "desc" : "True if the event is being listened for, else false"
849 "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.",
850 "sig" : "(o, fn, scope)",
852 "memberOf" : "Roo.util.Observable",
854 "isConstructor" : false,
865 "type" : "Observable",
866 "desc" : "The Observable to capture",
872 "desc" : "The function to call",
878 "desc" : "(optional) The scope (this object) for the fn",
885 "name" : "addListener",
887 "desc" : "Appends an event handler to this component",
888 "sig" : "(eventName, handler, scope, options)",
890 "memberOf" : "Roo.util.Observable",
892 "isConstructor" : false,
902 "name" : "eventName",
904 "desc" : "The type of event to listen for",
910 "desc" : "The method the event invokes",
916 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
922 "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>",
933 "desc" : "Fires when a template node is double clicked.",
934 "sig" : "function (_self, index, node, e)\n{\n\n}",
950 "desc" : "The index of the target node",
955 "type" : "HTMLElement",
956 "desc" : "The target node",
961 "type" : "Roo.EventObject",
962 "desc" : "The raw event object",
969 "name" : "preparedata",
971 "desc" : "Fires on every row to render, to allow you to change the data.",
972 "sig" : "function (_self, data)\n{\n\n}",
988 "desc" : "to be rendered (change this)",
995 "name" : "selectionchange",
997 "desc" : "Fires when the selected nodes change.",
998 "sig" : "function (_self, selections)\n{\n\n}",
1007 "type" : "Roo.View",
1009 "isOptional" : false
1012 "name" : "selections",
1014 "desc" : "Array of the selected nodes",
1015 "isOptional" : false
1021 "name" : "beforeselect",
1022 "type" : "function",
1023 "desc" : "Fires before a selection is made. If any handlers return false, the selection is cancelled.",
1024 "sig" : "function (_self, node, selections)\n{\n\n}",
1033 "type" : "Roo.View",
1035 "isOptional" : false
1039 "type" : "HTMLElement",
1040 "desc" : "The node to be selected",
1041 "isOptional" : false
1044 "name" : "selections",
1046 "desc" : "Array of currently selected nodes",
1047 "isOptional" : false
1053 "name" : "beforeclick",
1054 "type" : "function",
1055 "desc" : "Fires before a click is processed. Returns false to cancel the default action.",
1056 "sig" : "function (_self, index, node, e)\n{\n\n}",
1065 "type" : "Roo.View",
1067 "isOptional" : false
1072 "desc" : "The index of the target node",
1073 "isOptional" : false
1077 "type" : "HTMLElement",
1078 "desc" : "The target node",
1079 "isOptional" : false
1083 "type" : "Roo.EventObject",
1084 "desc" : "The raw event object",
1085 "isOptional" : false
1092 "type" : "function",
1093 "desc" : "Fires when a template node is clicked.",
1094 "sig" : "function (_self, index, node, e)\n{\n\n}",
1103 "type" : "Roo.View",
1105 "isOptional" : false
1110 "desc" : "The index of the target node",
1111 "isOptional" : false
1115 "type" : "HTMLElement",
1116 "desc" : "The target node",
1117 "isOptional" : false
1121 "type" : "Roo.EventObject",
1122 "desc" : "The raw event object",
1123 "isOptional" : false
1129 "name" : "contextmenu",
1130 "type" : "function",
1131 "desc" : "Fires when a template node is right clicked.",
1132 "sig" : "function (_self, index, node, e)\n{\n\n}",
1141 "type" : "Roo.View",
1143 "isOptional" : false
1148 "desc" : "The index of the target node",
1149 "isOptional" : false
1153 "type" : "HTMLElement",
1154 "desc" : "The target node",
1155 "isOptional" : false
1159 "type" : "Roo.EventObject",
1160 "desc" : "The raw event object",
1161 "isOptional" : false