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)",
12 "name" : "selectedClass",
14 "desc" : "The css class to add to selected nodes",
15 "memberOf" : "Roo.View",
22 "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>",
23 "memberOf" : "Roo.util.Observable",
30 "desc" : "the named area of the template to use as the data area\n Works with domtemplates roo-name=\"name\"",
31 "memberOf" : "Roo.View",
38 "desc" : "to display on mask (default Loading)",
39 "memberOf" : "Roo.View",
44 "name" : "multiSelect",
46 "desc" : "Allow multiple selection",
47 "memberOf" : "Roo.View",
54 "desc" : "The empty text to show when nothing is loaded.",
55 "memberOf" : "Roo.View",
61 "type" : "Roo.data.Store",
62 "desc" : "Data store to load data from.",
63 "memberOf" : "Roo.View",
68 "name" : "toggleSelect",
70 "desc" : "- selecting",
71 "memberOf" : "Roo.View",
76 "name" : "singleSelect",
78 "desc" : "Allow single selection",
79 "memberOf" : "Roo.View",
86 "desc" : "- selecting",
87 "memberOf" : "Roo.View",
93 "type" : "String|Roo.Element",
94 "desc" : "The container element.",
95 "memberOf" : "Roo.View",
101 "type" : "String|Roo.Template",
102 "desc" : "The template used by this View",
103 "memberOf" : "Roo.View",
110 "name" : "getSelectedNodes",
111 "desc" : "Get the currently selected nodes.",
113 "isConstructor" : false,
115 "memberOf" : "Roo.View",
126 "desc" : "An array of HTMLElements"
132 "desc" : "Gets a range template nodes.",
134 "isConstructor" : false,
136 "memberOf" : "Roo.View",
143 "name" : "startIndex",
159 "desc" : "An array of nodes"
165 "desc" : "Selects nodes.",
167 "isConstructor" : false,
169 "memberOf" : "Roo.View",
177 "type" : "Array/HTMLElement/String/Number",
178 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
182 "name" : "keepExisting",
184 "desc" : "(optional) true to keep existing selections",
188 "name" : "suppressEvent",
190 "desc" : "(optional) true to skip firing of the selectionchange vent",
198 "name" : "clearSelections",
199 "desc" : "Clear all selections",
201 "isConstructor" : false,
203 "memberOf" : "Roo.View",
210 "name" : "suppressEvent",
212 "desc" : "(optional) true to skip firing of the selectionchange event",
220 "name" : "isSelected",
221 "desc" : "Returns true if the passed node is selected",
223 "isConstructor" : false,
225 "memberOf" : "Roo.View",
233 "type" : "HTMLElement/Number",
234 "desc" : "The node or node index",
248 "desc" : "Refreshes the view. - called by datachanged on the store. - do not call directly.",
250 "isConstructor" : false,
252 "memberOf" : "Roo.View",
263 "name" : "onBeforeLoad",
264 "desc" : "onbeforeLoad - masks the loading area.",
266 "isConstructor" : false,
268 "memberOf" : "Roo.View",
279 "name" : "getSelectedIndexes",
280 "desc" : "Get the indexes of the selected nodes.",
282 "isConstructor" : false,
284 "memberOf" : "Roo.View",
301 "desc" : "Finds the index of the passed node",
303 "isConstructor" : false,
305 "memberOf" : "Roo.View",
313 "type" : "HTMLElement/String/Number",
314 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
322 "desc" : "The index of the node or -1"
328 "desc" : "Returns the element this view is bound to.",
330 "isConstructor" : false,
332 "memberOf" : "Roo.View",
342 "type" : "Roo.Element",
349 "desc" : "Changes the data store this view uses and refresh the view.",
351 "isConstructor" : false,
353 "memberOf" : "Roo.View",
370 "name" : "refreshNode",
371 "desc" : "Refresh an individual node.",
373 "isConstructor" : false,
375 "memberOf" : "Roo.View",
392 "name" : "prepareData",
393 "desc" : "Function to override to reformat the data that is sent to\nthe template for each node.\nDEPRICATED - use the preparedata event handler.",
395 "isConstructor" : false,
397 "memberOf" : "Roo.View",
405 "type" : "Array/Object",
406 "desc" : "The raw data (array of colData for a data model bound view or\na JSON object for an UpdateManager bound view).",
414 "name" : "getSelectionCount",
415 "desc" : "Get the number of selected nodes.",
417 "isConstructor" : false,
419 "memberOf" : "Roo.View",
435 "name" : "findItemFromChild",
436 "desc" : "Returns the template node the passed child belongs to or null if it doesn't belong to one.",
438 "isConstructor" : false,
440 "memberOf" : "Roo.View",
448 "type" : "HTMLElement",
456 "type" : "HTMLElement",
457 "desc" : "The template node"
463 "desc" : "Unselects nodes.",
465 "isConstructor" : false,
467 "memberOf" : "Roo.View",
475 "type" : "Array/HTMLElement/String/Number",
476 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
480 "name" : "keepExisting",
482 "desc" : "(optional) true IGNORED (for campatibility with select)",
486 "name" : "suppressEvent",
488 "desc" : "(optional) true to skip firing of the selectionchange vent",
497 "desc" : "Gets a template node.",
499 "isConstructor" : false,
501 "memberOf" : "Roo.View",
509 "type" : "HTMLElement/String/Number",
510 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
517 "type" : "HTMLElement",
518 "desc" : "The node or null if it wasn't found"
523 "name" : "purgeListeners",
524 "desc" : "Removes all listeners for this object",
526 "isConstructor" : false,
528 "memberOf" : "Roo.util.Observable",
540 "desc" : "Appends an event handler to this element (shorthand for addListener)",
542 "isConstructor" : false,
544 "memberOf" : "Roo.util.Observable",
551 "name" : "eventName",
553 "desc" : "The type of event to listen for",
559 "desc" : "The method the event invokes",
565 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
571 "desc" : "(optional)",
580 "desc" : "Removes a listener (shorthand for removeListener)",
582 "isConstructor" : false,
584 "memberOf" : "Roo.util.Observable",
591 "name" : "eventName",
593 "desc" : "The type of event to listen for",
599 "desc" : "The handler to remove",
605 "desc" : "(optional) The scope (this object) for the handler",
613 "name" : "addEvents",
614 "desc" : "Used to define events on this Observable",
616 "isConstructor" : false,
618 "memberOf" : "Roo.util.Observable",
627 "desc" : "The object with the events defined",
635 "name" : "releaseCapture",
636 "desc" : "Removes <b>all</b> added captures from the Observable.",
638 "isConstructor" : false,
640 "memberOf" : "Roo.util.Observable",
648 "type" : "Observable",
649 "desc" : "The Observable to release",
657 "name" : "removeListener",
658 "desc" : "Removes a listener",
660 "isConstructor" : false,
662 "memberOf" : "Roo.util.Observable",
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",
691 "name" : "fireEvent",
692 "desc" : "Fires the specified event with the passed parameters (minus the event name).",
694 "isConstructor" : false,
696 "memberOf" : "Roo.util.Observable",
703 "name" : "eventName",
710 "type" : "Object...",
711 "desc" : "Variable number of parameters are passed to handlers",
719 "desc" : "returns false if any of the handlers return false otherwise it returns true"
724 "name" : "hasListener",
725 "desc" : "Checks to see if this object has any listeners for a specified event",
727 "isConstructor" : false,
729 "memberOf" : "Roo.util.Observable",
736 "name" : "eventName",
738 "desc" : "The name of the event to check for",
746 "desc" : "True if the event is being listened for, else false"
752 "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.",
754 "isConstructor" : false,
756 "memberOf" : "Roo.util.Observable",
764 "type" : "Observable",
765 "desc" : "The Observable to capture",
771 "desc" : "The function to call",
777 "desc" : "(optional) The scope (this object) for the fn",
785 "name" : "addListener",
786 "desc" : "Appends an event handler to this component",
788 "isConstructor" : false,
790 "memberOf" : "Roo.util.Observable",
797 "name" : "eventName",
799 "desc" : "The type of event to listen for",
805 "desc" : "The method the event invokes",
811 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
817 "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>",
828 "desc" : "Fires when a template node is double clicked.",
844 "desc" : "The index of the target node",
849 "type" : "HTMLElement",
850 "desc" : "The target node",
855 "type" : "Roo.EventObject",
856 "desc" : "The raw event object",
864 "name" : "preparedata",
865 "desc" : "Fires on every row to render, to allow you to change the data.",
881 "desc" : "to be rendered (change this)",
889 "name" : "selectionchange",
890 "desc" : "Fires when the selected nodes change.",
904 "name" : "selections",
906 "desc" : "Array of the selected nodes",
914 "name" : "beforeselect",
915 "desc" : "Fires before a selection is made. If any handlers return false, the selection is cancelled.",
930 "type" : "HTMLElement",
931 "desc" : "The node to be selected",
935 "name" : "selections",
937 "desc" : "Array of currently selected nodes",
945 "name" : "beforeclick",
946 "desc" : "Fires before a click is processed. Returns false to cancel the default action.",
962 "desc" : "The index of the target node",
967 "type" : "HTMLElement",
968 "desc" : "The target node",
973 "type" : "Roo.EventObject",
974 "desc" : "The raw event object",
983 "desc" : "Fires when a template node is clicked.",
999 "desc" : "The index of the target node",
1000 "isOptional" : false
1004 "type" : "HTMLElement",
1005 "desc" : "The target node",
1006 "isOptional" : false
1010 "type" : "Roo.EventObject",
1011 "desc" : "The raw event object",
1012 "isOptional" : false
1019 "name" : "contextmenu",
1020 "desc" : "Fires when a template node is right clicked.",
1029 "type" : "Roo.View",
1031 "isOptional" : false
1036 "desc" : "The index of the target node",
1037 "isOptional" : false
1041 "type" : "HTMLElement",
1042 "desc" : "The target node",
1043 "isOptional" : false
1047 "type" : "Roo.EventObject",
1048 "desc" : "The raw event object",
1049 "isOptional" : false