9 "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)",
10 "isSingleton" : false,
22 "desc" : "The config object",
31 "name" : "selectedClass",
33 "desc" : "The css class to add to selected nodes",
39 "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>",
40 "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\"",
51 "desc" : "to display on mask (default Loading)",
55 "name" : "multiSelect",
57 "desc" : "Allow multiple selection",
63 "desc" : "The empty text to show when nothing is loaded.",
68 "type" : "Roo.data.Store",
69 "desc" : "Data store to load data from.",
73 "name" : "toggleSelect",
75 "desc" : "- selecting",
79 "name" : "singleSelect",
81 "desc" : "Allow single selection",
87 "desc" : "- selecting",
92 "type" : "String|Roo.Element",
93 "desc" : "The container element.",
98 "type" : "String|Roo.Template",
99 "desc" : "The template used by this View",
105 "name" : "getSelectedNodes",
107 "desc" : "Get the currently selected nodes.",
108 "sig" : "()\n{\n\n}",
112 "isConstructor" : false,
125 "desc" : "An array of HTMLElements"
132 "desc" : "Gets a range template nodes.",
133 "sig" : "(startIndex, endIndex)",
137 "isConstructor" : false,
147 "name" : "startIndex",
163 "desc" : "An array of nodes"
170 "desc" : "Selects nodes.",
171 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
175 "isConstructor" : false,
186 "type" : "Array/HTMLElement/String/Number",
187 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
191 "name" : "keepExisting",
193 "desc" : "(optional) true to keep existing selections",
197 "name" : "suppressEvent",
199 "desc" : "(optional) true to skip firing of the selectionchange vent",
206 "name" : "clearSelections",
208 "desc" : "Clear all selections",
209 "sig" : "(suppressEvent)",
213 "isConstructor" : false,
223 "name" : "suppressEvent",
225 "desc" : "(optional) true to skip firing of the selectionchange event",
232 "name" : "isSelected",
234 "desc" : "Returns true if the passed node is selected",
239 "isConstructor" : false,
250 "type" : "HTMLElement/Number",
251 "desc" : "The node or node index",
266 "desc" : "Refreshes the view. - called by datachanged on the store. - do not call directly.",
267 "sig" : "()\n{\n\n}",
271 "isConstructor" : false,
283 "name" : "onBeforeLoad",
285 "desc" : "onbeforeLoad - masks the loading area.",
286 "sig" : "()\n{\n\n}",
290 "isConstructor" : false,
302 "name" : "getSelectedIndexes",
304 "desc" : "Get the indexes of the selected nodes.",
305 "sig" : "()\n{\n\n}",
309 "isConstructor" : false,
329 "desc" : "Finds the index of the passed node",
330 "sig" : "(nodeInfo)",
334 "isConstructor" : false,
345 "type" : "HTMLElement/String/Number",
346 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
354 "desc" : "The index of the node or -1"
361 "desc" : "Returns the element this view is bound to.",
362 "sig" : "()\n{\n\n}",
366 "isConstructor" : false,
378 "type" : "Roo.Element",
386 "desc" : "Changes the data store this view uses and refresh the view.",
391 "isConstructor" : false,
410 "name" : "refreshNode",
412 "desc" : "Refresh an individual node.",
417 "isConstructor" : false,
436 "name" : "prepareData",
438 "desc" : "Function to override to reformat the data that is sent to\nthe template for each node.\nDEPRICATED - use the preparedata event handler.",
443 "isConstructor" : false,
454 "type" : "Array/Object",
455 "desc" : "The raw data (array of colData for a data model bound view or\na JSON object for an UpdateManager bound view).",
462 "name" : "getSelectionCount",
464 "desc" : "Get the number of selected nodes.",
465 "sig" : "()\n{\n\n}",
469 "isConstructor" : false,
487 "name" : "findItemFromChild",
489 "desc" : "Returns the template node the passed child belongs to or null if it doesn't belong to one.",
494 "isConstructor" : false,
505 "type" : "HTMLElement",
513 "type" : "HTMLElement",
514 "desc" : "The template node"
521 "desc" : "Unselects nodes.",
522 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
526 "isConstructor" : false,
537 "type" : "Array/HTMLElement/String/Number",
538 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
542 "name" : "keepExisting",
544 "desc" : "(optional) true IGNORED (for campatibility with select)",
548 "name" : "suppressEvent",
550 "desc" : "(optional) true to skip firing of the selectionchange vent",
559 "desc" : "Gets a template node.",
560 "sig" : "(nodeInfo)",
564 "isConstructor" : false,
575 "type" : "HTMLElement/String/Number",
576 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
583 "type" : "HTMLElement",
584 "desc" : "The node or null if it wasn't found"
589 "name" : "purgeListeners",
591 "desc" : "Removes all listeners for this object",
592 "sig" : "()\n{\n\n}",
594 "memberOf" : "Roo.util.Observable",
596 "isConstructor" : false,
610 "desc" : "Appends an event handler to this element (shorthand for addListener)",
611 "sig" : "(eventName, handler, scope, options)",
613 "memberOf" : "Roo.util.Observable",
615 "isConstructor" : false,
625 "name" : "eventName",
627 "desc" : "The type of event to listen for",
633 "desc" : "The method the event invokes",
639 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
645 "desc" : "(optional)",
654 "desc" : "Removes a listener (shorthand for removeListener)",
655 "sig" : "(eventName, handler, scope)",
657 "memberOf" : "Roo.util.Observable",
659 "isConstructor" : false,
669 "name" : "eventName",
671 "desc" : "The type of event to listen for",
677 "desc" : "The handler to remove",
683 "desc" : "(optional) The scope (this object) for the handler",
690 "name" : "addEvents",
692 "desc" : "Used to define events on this Observable",
695 "memberOf" : "Roo.util.Observable",
697 "isConstructor" : false,
709 "desc" : "The object with the events defined",
716 "name" : "releaseCapture",
718 "desc" : "Removes <b>all</b> added captures from the Observable.",
721 "memberOf" : "Roo.util.Observable",
723 "isConstructor" : false,
734 "type" : "Observable",
735 "desc" : "The Observable to release",
742 "name" : "removeListener",
744 "desc" : "Removes a listener",
745 "sig" : "(eventName, handler, scope)",
747 "memberOf" : "Roo.util.Observable",
749 "isConstructor" : false,
759 "name" : "eventName",
761 "desc" : "The type of event to listen for",
767 "desc" : "The handler to remove",
773 "desc" : "(optional) The scope (this object) for the handler",
780 "name" : "fireEvent",
782 "desc" : "Fires the specified event with the passed parameters (minus the event name).",
783 "sig" : "(eventName, args)",
785 "memberOf" : "Roo.util.Observable",
787 "isConstructor" : false,
797 "name" : "eventName",
804 "type" : "Object...",
805 "desc" : "Variable number of parameters are passed to handlers",
813 "desc" : "returns false if any of the handlers return false otherwise it returns true"
818 "name" : "hasListener",
820 "desc" : "Checks to see if this object has any listeners for a specified event",
821 "sig" : "(eventName)",
823 "memberOf" : "Roo.util.Observable",
825 "isConstructor" : false,
835 "name" : "eventName",
837 "desc" : "The name of the event to check for",
845 "desc" : "True if the event is being listened for, else false"
852 "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.",
853 "sig" : "(o, fn, scope)",
855 "memberOf" : "Roo.util.Observable",
857 "isConstructor" : false,
868 "type" : "Observable",
869 "desc" : "The Observable to capture",
875 "desc" : "The function to call",
881 "desc" : "(optional) The scope (this object) for the fn",
888 "name" : "addListener",
890 "desc" : "Appends an event handler to this component",
891 "sig" : "(eventName, handler, scope, options)",
893 "memberOf" : "Roo.util.Observable",
895 "isConstructor" : false,
905 "name" : "eventName",
907 "desc" : "The type of event to listen for",
913 "desc" : "The method the event invokes",
919 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
925 "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>",
936 "desc" : "Fires when a template node is double clicked.",
937 "sig" : "function (_self, index, node, e)\n{\n\n}",
953 "desc" : "The index of the target node",
958 "type" : "HTMLElement",
959 "desc" : "The target node",
964 "type" : "Roo.EventObject",
965 "desc" : "The raw event object",
972 "name" : "preparedata",
974 "desc" : "Fires on every row to render, to allow you to change the data.",
975 "sig" : "function (_self, data)\n{\n\n}",
991 "desc" : "to be rendered (change this)",
998 "name" : "selectionchange",
1000 "desc" : "Fires when the selected nodes change.",
1001 "sig" : "function (_self, selections)\n{\n\n}",
1010 "type" : "Roo.View",
1012 "isOptional" : false
1015 "name" : "selections",
1017 "desc" : "Array of the selected nodes",
1018 "isOptional" : false
1024 "name" : "beforeselect",
1025 "type" : "function",
1026 "desc" : "Fires before a selection is made. If any handlers return false, the selection is cancelled.",
1027 "sig" : "function (_self, node, selections)\n{\n\n}",
1036 "type" : "Roo.View",
1038 "isOptional" : false
1042 "type" : "HTMLElement",
1043 "desc" : "The node to be selected",
1044 "isOptional" : false
1047 "name" : "selections",
1049 "desc" : "Array of currently selected nodes",
1050 "isOptional" : false
1056 "name" : "beforeclick",
1057 "type" : "function",
1058 "desc" : "Fires before a click is processed. Returns false to cancel the default action.",
1059 "sig" : "function (_self, index, node, e)\n{\n\n}",
1068 "type" : "Roo.View",
1070 "isOptional" : false
1075 "desc" : "The index of the target node",
1076 "isOptional" : false
1080 "type" : "HTMLElement",
1081 "desc" : "The target node",
1082 "isOptional" : false
1086 "type" : "Roo.EventObject",
1087 "desc" : "The raw event object",
1088 "isOptional" : false
1095 "type" : "function",
1096 "desc" : "Fires when a template node is clicked.",
1097 "sig" : "function (_self, index, node, e)\n{\n\n}",
1106 "type" : "Roo.View",
1108 "isOptional" : false
1113 "desc" : "The index of the target node",
1114 "isOptional" : false
1118 "type" : "HTMLElement",
1119 "desc" : "The target node",
1120 "isOptional" : false
1124 "type" : "Roo.EventObject",
1125 "desc" : "The raw event object",
1126 "isOptional" : false
1132 "name" : "contextmenu",
1133 "type" : "function",
1134 "desc" : "Fires when a template node is right clicked.",
1135 "sig" : "function (_self, index, node, e)\n{\n\n}",
1144 "type" : "Roo.View",
1146 "isOptional" : false
1151 "desc" : "The index of the target node",
1152 "isOptional" : false
1156 "type" : "HTMLElement",
1157 "desc" : "The target node",
1158 "isOptional" : false
1162 "type" : "Roo.EventObject",
1163 "desc" : "The raw event object",
1164 "isOptional" : false