13 "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)",
14 "isSingleton" : false,
18 "isBuilderTop" : false,
28 "desc" : "The config object",
37 "name" : "selectedClass",
39 "desc" : "The css class to add to selected nodes",
45 "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>",
46 "memberOf" : "Roo.util.Observable"
51 "desc" : "the named area of the template to use as the data area\n Works with domtemplates roo-name=\"name\"",
57 "desc" : "to display on mask (default Loading)",
61 "name" : "multiSelect",
63 "desc" : "Allow multiple selection",
69 "desc" : "The empty text to show when nothing is loaded.",
74 "type" : "Roo.data.Store",
75 "desc" : "Data store to load data from.",
79 "name" : "toggleSelect",
81 "desc" : "- selecting",
85 "name" : "singleSelect",
87 "desc" : "Allow single selection",
93 "desc" : "- selecting",
98 "type" : "String|Roo.Element",
99 "desc" : "The container element.",
104 "type" : "String|Roo.Template",
105 "desc" : "The template used by this View",
111 "name" : "getSelectedNodes",
113 "desc" : "Get the currently selected nodes.",
114 "sig" : "()\n{\n\n}",
118 "isConstructor" : false,
131 "desc" : "An array of HTMLElements"
138 "desc" : "Gets a range template nodes.",
139 "sig" : "(startIndex, endIndex)",
143 "isConstructor" : false,
153 "name" : "startIndex",
169 "desc" : "An array of nodes"
176 "desc" : "Selects nodes.",
177 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
181 "isConstructor" : false,
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",
212 "name" : "clearSelections",
214 "desc" : "Clear all selections",
215 "sig" : "(suppressEvent)",
219 "isConstructor" : false,
229 "name" : "suppressEvent",
231 "desc" : "(optional) true to skip firing of the selectionchange event",
238 "name" : "isSelected",
240 "desc" : "Returns true if the passed node is selected",
245 "isConstructor" : false,
256 "type" : "HTMLElement/Number",
257 "desc" : "The node or node index",
272 "desc" : "Refreshes the view. - called by datachanged on the store. - do not call directly.",
273 "sig" : "()\n{\n\n}",
277 "isConstructor" : false,
289 "name" : "onBeforeLoad",
291 "desc" : "onbeforeLoad - masks the loading area.",
292 "sig" : "()\n{\n\n}",
296 "isConstructor" : false,
308 "name" : "getSelectedIndexes",
310 "desc" : "Get the indexes of the selected nodes.",
311 "sig" : "()\n{\n\n}",
315 "isConstructor" : false,
335 "desc" : "Finds the index of the passed node",
336 "sig" : "(nodeInfo)",
340 "isConstructor" : false,
351 "type" : "HTMLElement/String/Number",
352 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
360 "desc" : "The index of the node or -1"
367 "desc" : "Returns the element this view is bound to.",
368 "sig" : "()\n{\n\n}",
372 "isConstructor" : false,
384 "type" : "Roo.Element",
392 "desc" : "Changes the data store this view uses and refresh the view.",
397 "isConstructor" : false,
416 "name" : "refreshNode",
418 "desc" : "Refresh an individual node.",
423 "isConstructor" : false,
442 "name" : "prepareData",
444 "desc" : "Function to override to reformat the data that is sent to\nthe template for each node.\nDEPRICATED - use the preparedata event handler.",
449 "isConstructor" : false,
460 "type" : "Array/Object",
461 "desc" : "The raw data (array of colData for a data model bound view or\na JSON object for an UpdateManager bound view).",
468 "name" : "getSelectionCount",
470 "desc" : "Get the number of selected nodes.",
471 "sig" : "()\n{\n\n}",
475 "isConstructor" : false,
493 "name" : "findItemFromChild",
495 "desc" : "Returns the template node the passed child belongs to or null if it doesn't belong to one.",
500 "isConstructor" : false,
511 "type" : "HTMLElement",
519 "type" : "HTMLElement",
520 "desc" : "The template node"
527 "desc" : "Unselects nodes.",
528 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
532 "isConstructor" : false,
543 "type" : "Array/HTMLElement/String/Number",
544 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
548 "name" : "keepExisting",
550 "desc" : "(optional) true IGNORED (for campatibility with select)",
554 "name" : "suppressEvent",
556 "desc" : "(optional) true to skip firing of the selectionchange vent",
565 "desc" : "Gets a template node.",
566 "sig" : "(nodeInfo)",
570 "isConstructor" : false,
581 "type" : "HTMLElement/String/Number",
582 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
589 "type" : "HTMLElement",
590 "desc" : "The node or null if it wasn't found"
595 "name" : "purgeListeners",
597 "desc" : "Removes all listeners for this object",
598 "sig" : "()\n{\n\n}",
600 "memberOf" : "Roo.util.Observable",
602 "isConstructor" : false,
616 "desc" : "Appends an event handler to this element (shorthand for addListener)",
617 "sig" : "(eventName, handler, scope, options)",
619 "memberOf" : "Roo.util.Observable",
621 "isConstructor" : false,
631 "name" : "eventName",
633 "desc" : "The type of event to listen for",
639 "desc" : "The method the event invokes",
645 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
651 "desc" : "(optional)",
660 "desc" : "Removes a listener (shorthand for removeListener)",
661 "sig" : "(eventName, handler, scope)",
663 "memberOf" : "Roo.util.Observable",
665 "isConstructor" : false,
675 "name" : "eventName",
677 "desc" : "The type of event to listen for",
683 "desc" : "The handler to remove",
689 "desc" : "(optional) The scope (this object) for the handler",
696 "name" : "addEvents",
698 "desc" : "Used to define events on this Observable",
701 "memberOf" : "Roo.util.Observable",
703 "isConstructor" : false,
715 "desc" : "The object with the events defined",
722 "name" : "releaseCapture",
724 "desc" : "Removes <b>all</b> added captures from the Observable.",
727 "memberOf" : "Roo.util.Observable",
729 "isConstructor" : false,
740 "type" : "Observable",
741 "desc" : "The Observable to release",
748 "name" : "removeListener",
750 "desc" : "Removes a listener",
751 "sig" : "(eventName, handler, scope)",
753 "memberOf" : "Roo.util.Observable",
755 "isConstructor" : false,
765 "name" : "eventName",
767 "desc" : "The type of event to listen for",
773 "desc" : "The handler to remove",
779 "desc" : "(optional) The scope (this object) for the handler",
786 "name" : "fireEvent",
788 "desc" : "Fires the specified event with the passed parameters (minus the event name).",
789 "sig" : "(eventName, args)",
791 "memberOf" : "Roo.util.Observable",
793 "isConstructor" : false,
803 "name" : "eventName",
810 "type" : "Object...",
811 "desc" : "Variable number of parameters are passed to handlers",
819 "desc" : "returns false if any of the handlers return false otherwise it returns true"
824 "name" : "hasListener",
826 "desc" : "Checks to see if this object has any listeners for a specified event",
827 "sig" : "(eventName)",
829 "memberOf" : "Roo.util.Observable",
831 "isConstructor" : false,
841 "name" : "eventName",
843 "desc" : "The name of the event to check for",
851 "desc" : "True if the event is being listened for, else false"
858 "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.",
859 "sig" : "(o, fn, scope)",
861 "memberOf" : "Roo.util.Observable",
863 "isConstructor" : false,
874 "type" : "Observable",
875 "desc" : "The Observable to capture",
881 "desc" : "The function to call",
887 "desc" : "(optional) The scope (this object) for the fn",
894 "name" : "addListener",
896 "desc" : "Appends an event handler to this component",
897 "sig" : "(eventName, handler, scope, options)",
899 "memberOf" : "Roo.util.Observable",
901 "isConstructor" : false,
911 "name" : "eventName",
913 "desc" : "The type of event to listen for",
919 "desc" : "The method the event invokes",
925 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
931 "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>",
942 "desc" : "Fires when a template node is double clicked.",
943 "sig" : "function (_self, index, node, e)\n{\n\n}",
959 "desc" : "The index of the target node",
964 "type" : "HTMLElement",
965 "desc" : "The target node",
970 "type" : "Roo.EventObject",
971 "desc" : "The raw event object",
978 "name" : "preparedata",
980 "desc" : "Fires on every row to render, to allow you to change the data.",
981 "sig" : "function (_self, data)\n{\n\n}",
997 "desc" : "to be rendered (change this)",
1004 "name" : "selectionchange",
1005 "type" : "function",
1006 "desc" : "Fires when the selected nodes change.",
1007 "sig" : "function (_self, selections)\n{\n\n}",
1016 "type" : "Roo.View",
1018 "isOptional" : false
1021 "name" : "selections",
1023 "desc" : "Array of the selected nodes",
1024 "isOptional" : false
1030 "name" : "beforeselect",
1031 "type" : "function",
1032 "desc" : "Fires before a selection is made. If any handlers return false, the selection is cancelled.",
1033 "sig" : "function (_self, node, selections)\n{\n\n}",
1042 "type" : "Roo.View",
1044 "isOptional" : false
1048 "type" : "HTMLElement",
1049 "desc" : "The node to be selected",
1050 "isOptional" : false
1053 "name" : "selections",
1055 "desc" : "Array of currently selected nodes",
1056 "isOptional" : false
1062 "name" : "beforeclick",
1063 "type" : "function",
1064 "desc" : "Fires before a click is processed. Returns false to cancel the default action.",
1065 "sig" : "function (_self, index, node, e)\n{\n\n}",
1074 "type" : "Roo.View",
1076 "isOptional" : false
1081 "desc" : "The index of the target node",
1082 "isOptional" : false
1086 "type" : "HTMLElement",
1087 "desc" : "The target node",
1088 "isOptional" : false
1092 "type" : "Roo.EventObject",
1093 "desc" : "The raw event object",
1094 "isOptional" : false
1101 "type" : "function",
1102 "desc" : "Fires when a template node is clicked.",
1103 "sig" : "function (_self, index, node, e)\n{\n\n}",
1112 "type" : "Roo.View",
1114 "isOptional" : false
1119 "desc" : "The index of the target node",
1120 "isOptional" : false
1124 "type" : "HTMLElement",
1125 "desc" : "The target node",
1126 "isOptional" : false
1130 "type" : "Roo.EventObject",
1131 "desc" : "The raw event object",
1132 "isOptional" : false
1138 "name" : "contextmenu",
1139 "type" : "function",
1140 "desc" : "Fires when a template node is right clicked.",
1141 "sig" : "function (_self, index, node, e)\n{\n\n}",
1150 "type" : "Roo.View",
1152 "isOptional" : false
1157 "desc" : "The index of the target node",
1158 "isOptional" : false
1162 "type" : "HTMLElement",
1163 "desc" : "The target node",
1164 "isOptional" : false
1168 "type" : "Roo.EventObject",
1169 "desc" : "The raw event object",
1170 "isOptional" : false