2 "name" : "Roo.JsonView",
7 "desc" : "Shortcut class to create a JSON + {@link Roo.UpdateManager} template view. Usage:\n<pre><code>\nvar view = new Roo.JsonView({\n container: \"my-element\",\n tpl: '<div id=\"{id}\">{foo} - {bar}</div>', // auto create template\n multiSelect: true, \n jsonRoot: \"data\" \n});\n\n// listen for node click?\nview.on(\"click\", function(vw, index, node, e){\n alert('Node \"' + node.id + '\" at index: ' + index + \" was clicked.\");\n});\n\n// direct load of JSON data\nview.load(\"foobar.php\");\n\n// Example from my blog list\nvar tpl = new Roo.Template(\n '<div class=\"entry\">' +\n '<a class=\"entry-title\" href=\"{link}\">{title}</a>' +\n \"<h4>{date} by {author} | {comments} Comments</h4>{description}\" +\n \"</div><hr />\"\n);\n\nvar moreView = new Roo.JsonView({\n container : \"entry-list\", \n template : tpl,\n jsonRoot: \"posts\"\n});\nmoreView.on(\"beforerender\", this.sortEntries, this);\nmoreView.load({\n url: \"/blog/get-posts.php\",\n params: \"allposts=true\",\n text: \"Loading Blog Entries...\"\n});\n</code></pre>\n\nNote: old code is supported with arguments : (container, template, config)",
11 "memberOf" : "JsonView",
20 "desc" : "The config object",
29 "name" : "selectedClass",
31 "desc" : "The css class to add to selected nodes",
32 "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"
43 "desc" : "the named area of the template to use as the data area\n Works with domtemplates roo-name=\"name\"",
44 "memberOf" : "Roo.View"
49 "desc" : "to display on mask (default Loading)",
50 "memberOf" : "Roo.View"
53 "name" : "multiSelect",
55 "desc" : "Allow multiple selection",
56 "memberOf" : "Roo.View"
61 "desc" : "The empty text to show when nothing is loaded.",
62 "memberOf" : "Roo.View"
66 "type" : "Roo.data.Store",
67 "desc" : "Data store to load data from.",
68 "memberOf" : "Roo.View"
71 "name" : "toggleSelect",
73 "desc" : "- selecting",
74 "memberOf" : "Roo.View"
77 "name" : "singleSelect",
79 "desc" : "Allow single selection",
80 "memberOf" : "Roo.View"
85 "desc" : "- selecting",
86 "memberOf" : "Roo.View"
90 "type" : "String|Roo.Element",
91 "desc" : "The container element.",
92 "memberOf" : "Roo.View"
96 "type" : "String|Roo.Template",
97 "desc" : "The template used by this View",
98 "memberOf" : "Roo.View"
103 "name" : "getNodeData",
105 "desc" : "Returns the JSON object for the specified node(s)",
110 "isConstructor" : false,
121 "type" : "HTMLElement/Array",
122 "desc" : "The node or an array of nodes",
129 "type" : "Object/Array",
130 "desc" : "If you pass in an array, you get an array back, otherwise\nyou get the JSON object for the node"
137 "desc" : "Get the number of records in the current JSON dataset",
138 "sig" : "()\n{\n\n}",
142 "isConstructor" : false,
162 "desc" : "Sorts the data for this view and refreshes it.",
163 "sig" : "(property, direction, sortType)",
167 "isConstructor" : false,
179 "desc" : "A property on your JSON objects to sort on",
183 "name" : "direction",
185 "desc" : "(optional) \"desc\" or \"asc\" (defaults to \"asc\")",
191 "desc" : "(optional) A function to call to convert the data to a sortable value.",
200 "desc" : "Refreshes the view.",
201 "sig" : "()\n{\n\n}",
205 "isConstructor" : false,
219 "desc" : "Filter by a function. The passed function will be called with each\nobject in the current dataset. If the function returns true the value is kept,\notherwise it is filtered.",
220 "sig" : "(fn, scope)",
224 "isConstructor" : false,
242 "desc" : "(optional) The scope of the function (defaults to this JsonView)",
249 "name" : "clearFilter",
251 "desc" : "Clears the current filter.",
252 "sig" : "()\n{\n\n}",
256 "isConstructor" : false,
270 "desc" : "Performs an async HTTP request, and loads the JSON from the response. If <i>params</i> are specified it uses POST, otherwise it uses GET.",
271 "sig" : "(url, params, callback, discardUrl)",
275 "isConstructor" : false,
286 "type" : "Object/String/Function",
287 "desc" : "The URL for this request, or a function to call to get the URL, or a config object containing any of the following options:\n <pre><code>\n view.load({\n url: \"your-url.php\",\n params: {param1: \"foo\", param2: \"bar\"}, // or a URL encoded string\n callback: yourFunction,\n scope: yourObject, //(optional scope)\n discardUrl: false,\n nocache: false,\n text: \"Loading...\",\n timeout: 30,\n scripts: false\n });\n </code></pre>\nThe only required property is <i>url</i>. The optional properties <i>nocache</i>, <i>text</i> and <i>scripts</i>\nare respectively shorthand for <i>disableCaching</i>, <i>indicatorText</i>, and <i>loadScripts</i> and are used to set their associated property on this UpdateManager instance.",
292 "type" : "String/Object",
293 "desc" : "(optional) The parameters to pass, as either a URL encoded string \"param1=1&param2=2\" or an object {param1: 1, param2: 2}",
299 "desc" : "(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)",
303 "name" : "discardUrl",
305 "desc" : "(optional) By default when you execute an update the defaultUrl is changed to the last used URL. If true, it will not store the URL.",
314 "desc" : "Filter the data by a specific property.",
315 "sig" : "(property, value)",
319 "isConstructor" : false,
331 "desc" : "A property on your JSON objects",
336 "type" : "String/RegExp",
337 "desc" : "Either string that the property values\nshould start with, or a RegExp to test against the property",
344 "name" : "getSelectedNodes",
346 "desc" : "Get the currently selected nodes.",
347 "sig" : "()\n{\n\n}",
349 "memberOf" : "Roo.View",
351 "isConstructor" : false,
364 "desc" : "An array of HTMLElements"
371 "desc" : "Gets a range template nodes.",
372 "sig" : "(startIndex, endIndex)",
374 "memberOf" : "Roo.View",
376 "isConstructor" : false,
386 "name" : "startIndex",
402 "desc" : "An array of nodes"
409 "desc" : "Selects nodes.",
410 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
412 "memberOf" : "Roo.View",
414 "isConstructor" : false,
425 "type" : "Array/HTMLElement/String/Number",
426 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
430 "name" : "keepExisting",
432 "desc" : "(optional) true to keep existing selections",
436 "name" : "suppressEvent",
438 "desc" : "(optional) true to skip firing of the selectionchange vent",
445 "name" : "clearSelections",
447 "desc" : "Clear all selections",
448 "sig" : "(suppressEvent)",
450 "memberOf" : "Roo.View",
452 "isConstructor" : false,
462 "name" : "suppressEvent",
464 "desc" : "(optional) true to skip firing of the selectionchange event",
471 "name" : "isSelected",
473 "desc" : "Returns true if the passed node is selected",
476 "memberOf" : "Roo.View",
478 "isConstructor" : false,
489 "type" : "HTMLElement/Number",
490 "desc" : "The node or node index",
503 "name" : "onBeforeLoad",
505 "desc" : "onbeforeLoad - masks the loading area.",
506 "sig" : "()\n{\n\n}",
508 "memberOf" : "Roo.View",
510 "isConstructor" : false,
522 "name" : "getSelectedIndexes",
524 "desc" : "Get the indexes of the selected nodes.",
525 "sig" : "()\n{\n\n}",
527 "memberOf" : "Roo.View",
529 "isConstructor" : false,
549 "desc" : "Finds the index of the passed node",
550 "sig" : "(nodeInfo)",
552 "memberOf" : "Roo.View",
554 "isConstructor" : false,
565 "type" : "HTMLElement/String/Number",
566 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
574 "desc" : "The index of the node or -1"
581 "desc" : "Returns the element this view is bound to.",
582 "sig" : "()\n{\n\n}",
584 "memberOf" : "Roo.View",
586 "isConstructor" : false,
598 "type" : "Roo.Element",
606 "desc" : "Changes the data store this view uses and refresh the view.",
609 "memberOf" : "Roo.View",
611 "isConstructor" : false,
630 "name" : "refreshNode",
632 "desc" : "Refresh an individual node.",
635 "memberOf" : "Roo.View",
637 "isConstructor" : false,
656 "name" : "prepareData",
658 "desc" : "Function to override to reformat the data that is sent to\nthe template for each node.\nDEPRICATED - use the preparedata event handler.",
661 "memberOf" : "Roo.View",
663 "isConstructor" : false,
674 "type" : "Array/Object",
675 "desc" : "The raw data (array of colData for a data model bound view or\na JSON object for an UpdateManager bound view).",
682 "name" : "getSelectionCount",
684 "desc" : "Get the number of selected nodes.",
685 "sig" : "()\n{\n\n}",
687 "memberOf" : "Roo.View",
689 "isConstructor" : false,
707 "name" : "findItemFromChild",
709 "desc" : "Returns the template node the passed child belongs to or null if it doesn't belong to one.",
712 "memberOf" : "Roo.View",
714 "isConstructor" : false,
725 "type" : "HTMLElement",
733 "type" : "HTMLElement",
734 "desc" : "The template node"
741 "desc" : "Unselects nodes.",
742 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
744 "memberOf" : "Roo.View",
746 "isConstructor" : false,
757 "type" : "Array/HTMLElement/String/Number",
758 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
762 "name" : "keepExisting",
764 "desc" : "(optional) true IGNORED (for campatibility with select)",
768 "name" : "suppressEvent",
770 "desc" : "(optional) true to skip firing of the selectionchange vent",
779 "desc" : "Gets a template node.",
780 "sig" : "(nodeInfo)",
782 "memberOf" : "Roo.View",
784 "isConstructor" : false,
795 "type" : "HTMLElement/String/Number",
796 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
803 "type" : "HTMLElement",
804 "desc" : "The node or null if it wasn't found"
809 "name" : "purgeListeners",
811 "desc" : "Removes all listeners for this object",
812 "sig" : "()\n{\n\n}",
814 "memberOf" : "Roo.util.Observable",
816 "isConstructor" : false,
830 "desc" : "Appends an event handler to this element (shorthand for addListener)",
831 "sig" : "(eventName, handler, scope, options)",
833 "memberOf" : "Roo.util.Observable",
835 "isConstructor" : false,
845 "name" : "eventName",
847 "desc" : "The type of event to listen for",
853 "desc" : "The method the event invokes",
859 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
865 "desc" : "(optional)",
874 "desc" : "Removes a listener (shorthand for removeListener)",
875 "sig" : "(eventName, handler, scope)",
877 "memberOf" : "Roo.util.Observable",
879 "isConstructor" : false,
889 "name" : "eventName",
891 "desc" : "The type of event to listen for",
897 "desc" : "The handler to remove",
903 "desc" : "(optional) The scope (this object) for the handler",
910 "name" : "addEvents",
912 "desc" : "Used to define events on this Observable",
915 "memberOf" : "Roo.util.Observable",
917 "isConstructor" : false,
929 "desc" : "The object with the events defined",
936 "name" : "releaseCapture",
938 "desc" : "Removes <b>all</b> added captures from the Observable.",
941 "memberOf" : "Roo.util.Observable",
943 "isConstructor" : false,
954 "type" : "Observable",
955 "desc" : "The Observable to release",
962 "name" : "removeListener",
964 "desc" : "Removes a listener",
965 "sig" : "(eventName, handler, scope)",
967 "memberOf" : "Roo.util.Observable",
969 "isConstructor" : false,
979 "name" : "eventName",
981 "desc" : "The type of event to listen for",
987 "desc" : "The handler to remove",
993 "desc" : "(optional) The scope (this object) for the handler",
1000 "name" : "fireEvent",
1001 "type" : "function",
1002 "desc" : "Fires the specified event with the passed parameters (minus the event name).",
1003 "sig" : "(eventName, args)",
1005 "memberOf" : "Roo.util.Observable",
1007 "isConstructor" : false,
1008 "isPrivate" : false,
1017 "name" : "eventName",
1020 "isOptional" : false
1024 "type" : "Object...",
1025 "desc" : "Variable number of parameters are passed to handlers",
1026 "isOptional" : false
1033 "desc" : "returns false if any of the handlers return false otherwise it returns true"
1038 "name" : "hasListener",
1039 "type" : "function",
1040 "desc" : "Checks to see if this object has any listeners for a specified event",
1041 "sig" : "(eventName)",
1043 "memberOf" : "Roo.util.Observable",
1045 "isConstructor" : false,
1046 "isPrivate" : false,
1055 "name" : "eventName",
1057 "desc" : "The name of the event to check for",
1058 "isOptional" : false
1065 "desc" : "True if the event is being listened for, else false"
1071 "type" : "function",
1072 "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.",
1073 "sig" : "(o, fn, scope)",
1075 "memberOf" : "Roo.util.Observable",
1077 "isConstructor" : false,
1078 "isPrivate" : false,
1088 "type" : "Observable",
1089 "desc" : "The Observable to capture",
1090 "isOptional" : false
1094 "type" : "Function",
1095 "desc" : "The function to call",
1096 "isOptional" : false
1101 "desc" : "(optional) The scope (this object) for the fn",
1102 "isOptional" : false
1108 "name" : "addListener",
1109 "type" : "function",
1110 "desc" : "Appends an event handler to this component",
1111 "sig" : "(eventName, handler, scope, options)",
1113 "memberOf" : "Roo.util.Observable",
1115 "isConstructor" : false,
1116 "isPrivate" : false,
1125 "name" : "eventName",
1127 "desc" : "The type of event to listen for",
1128 "isOptional" : false
1132 "type" : "Function",
1133 "desc" : "The method the event invokes",
1134 "isOptional" : false
1139 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
1140 "isOptional" : false
1145 "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>",
1146 "isOptional" : false
1154 "name" : "loadexception",
1155 "type" : "function",
1156 "desc" : "Fires when loading fails.",
1157 "sig" : "function (_self, response)\n{\n\n}",
1166 "type" : "Roo.JsonView",
1168 "isOptional" : false
1171 "name" : "response",
1173 "desc" : "The raw Connect response object",
1174 "isOptional" : false
1181 "type" : "function",
1182 "desc" : "Fires when data is loaded.",
1183 "sig" : "function (_self, data, response)\n{\n\n}",
1192 "type" : "Roo.JsonView",
1194 "isOptional" : false
1199 "desc" : "The JSON data loaded",
1200 "isOptional" : false
1203 "name" : "response",
1205 "desc" : "The raw Connect response object",
1206 "isOptional" : false
1212 "name" : "beforerender",
1213 "type" : "function",
1214 "desc" : "Fires before rendering of the downloaded JSON data.",
1215 "sig" : "function (_self, data)\n{\n\n}",
1224 "type" : "Roo.JsonView",
1226 "isOptional" : false
1231 "desc" : "The JSON data loaded",
1232 "isOptional" : false
1238 "name" : "dblclick",
1239 "type" : "function",
1240 "desc" : "Fires when a template node is double clicked.",
1241 "sig" : "function (_self, index, node, e)\n{\n\n}",
1242 "memberOf" : "Roo.View",
1250 "type" : "Roo.View",
1252 "isOptional" : false
1257 "desc" : "The index of the target node",
1258 "isOptional" : false
1262 "type" : "HTMLElement",
1263 "desc" : "The target node",
1264 "isOptional" : false
1268 "type" : "Roo.EventObject",
1269 "desc" : "The raw event object",
1270 "isOptional" : false
1276 "name" : "preparedata",
1277 "type" : "function",
1278 "desc" : "Fires on every row to render, to allow you to change the data.",
1279 "sig" : "function (_self, data)\n{\n\n}",
1280 "memberOf" : "Roo.View",
1288 "type" : "Roo.View",
1290 "isOptional" : false
1295 "desc" : "to be rendered (change this)",
1296 "isOptional" : false
1302 "name" : "selectionchange",
1303 "type" : "function",
1304 "desc" : "Fires when the selected nodes change.",
1305 "sig" : "function (_self, selections)\n{\n\n}",
1306 "memberOf" : "Roo.View",
1314 "type" : "Roo.View",
1316 "isOptional" : false
1319 "name" : "selections",
1321 "desc" : "Array of the selected nodes",
1322 "isOptional" : false
1328 "name" : "beforeselect",
1329 "type" : "function",
1330 "desc" : "Fires before a selection is made. If any handlers return false, the selection is cancelled.",
1331 "sig" : "function (_self, node, selections)\n{\n\n}",
1332 "memberOf" : "Roo.View",
1340 "type" : "Roo.View",
1342 "isOptional" : false
1346 "type" : "HTMLElement",
1347 "desc" : "The node to be selected",
1348 "isOptional" : false
1351 "name" : "selections",
1353 "desc" : "Array of currently selected nodes",
1354 "isOptional" : false
1360 "name" : "beforeclick",
1361 "type" : "function",
1362 "desc" : "Fires before a click is processed. Returns false to cancel the default action.",
1363 "sig" : "function (_self, index, node, e)\n{\n\n}",
1364 "memberOf" : "Roo.View",
1372 "type" : "Roo.View",
1374 "isOptional" : false
1379 "desc" : "The index of the target node",
1380 "isOptional" : false
1384 "type" : "HTMLElement",
1385 "desc" : "The target node",
1386 "isOptional" : false
1390 "type" : "Roo.EventObject",
1391 "desc" : "The raw event object",
1392 "isOptional" : false
1399 "type" : "function",
1400 "desc" : "Fires when a template node is clicked.",
1401 "sig" : "function (_self, index, node, e)\n{\n\n}",
1402 "memberOf" : "Roo.View",
1410 "type" : "Roo.View",
1412 "isOptional" : false
1417 "desc" : "The index of the target node",
1418 "isOptional" : false
1422 "type" : "HTMLElement",
1423 "desc" : "The target node",
1424 "isOptional" : false
1428 "type" : "Roo.EventObject",
1429 "desc" : "The raw event object",
1430 "isOptional" : false
1436 "name" : "contextmenu",
1437 "type" : "function",
1438 "desc" : "Fires when a template node is right clicked.",
1439 "sig" : "function (_self, index, node, e)\n{\n\n}",
1440 "memberOf" : "Roo.View",
1448 "type" : "Roo.View",
1450 "isOptional" : false
1455 "desc" : "The index of the target node",
1456 "isOptional" : false
1460 "type" : "HTMLElement",
1461 "desc" : "The target node",
1462 "isOptional" : false
1466 "type" : "Roo.EventObject",
1467 "desc" : "The raw event object",
1468 "isOptional" : false