2 "name" : "Roo.JsonView",
8 "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)",
12 "memberOf" : "JsonView",
21 "desc" : "The config object",
30 "name" : "selectedClass",
32 "desc" : "The css class to add to selected nodes",
33 "memberOf" : "Roo.View"
38 "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>",
39 "memberOf" : "Roo.util.Observable"
44 "desc" : "the named area of the template to use as the data area\n Works with domtemplates roo-name=\"name\"",
45 "memberOf" : "Roo.View"
50 "desc" : "to display on mask (default Loading)",
51 "memberOf" : "Roo.View"
54 "name" : "multiSelect",
56 "desc" : "Allow multiple selection",
57 "memberOf" : "Roo.View"
62 "desc" : "The empty text to show when nothing is loaded.",
63 "memberOf" : "Roo.View"
67 "type" : "Roo.data.Store",
68 "desc" : "Data store to load data from.",
69 "memberOf" : "Roo.View"
72 "name" : "toggleSelect",
74 "desc" : "- selecting",
75 "memberOf" : "Roo.View"
78 "name" : "singleSelect",
80 "desc" : "Allow single selection",
81 "memberOf" : "Roo.View"
86 "desc" : "- selecting",
87 "memberOf" : "Roo.View"
91 "type" : "String|Roo.Element",
92 "desc" : "The container element.",
93 "memberOf" : "Roo.View"
97 "type" : "String|Roo.Template",
98 "desc" : "The template used by this View",
99 "memberOf" : "Roo.View"
104 "name" : "getNodeData",
106 "desc" : "Returns the JSON object for the specified node(s)",
111 "isConstructor" : false,
122 "type" : "HTMLElement/Array",
123 "desc" : "The node or an array of nodes",
130 "type" : "Object/Array",
131 "desc" : "If you pass in an array, you get an array back, otherwise\nyou get the JSON object for the node"
138 "desc" : "Get the number of records in the current JSON dataset",
139 "sig" : "()\n{\n\n}",
143 "isConstructor" : false,
163 "desc" : "Sorts the data for this view and refreshes it.",
164 "sig" : "(property, direction, sortType)",
168 "isConstructor" : false,
180 "desc" : "A property on your JSON objects to sort on",
184 "name" : "direction",
186 "desc" : "(optional) \"desc\" or \"asc\" (defaults to \"asc\")",
192 "desc" : "(optional) A function to call to convert the data to a sortable value.",
201 "desc" : "Refreshes the view.",
202 "sig" : "()\n{\n\n}",
206 "isConstructor" : false,
220 "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.",
221 "sig" : "(fn, scope)",
225 "isConstructor" : false,
243 "desc" : "(optional) The scope of the function (defaults to this JsonView)",
250 "name" : "clearFilter",
252 "desc" : "Clears the current filter.",
253 "sig" : "()\n{\n\n}",
257 "isConstructor" : false,
271 "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.",
272 "sig" : "(url, params, callback, discardUrl)",
276 "isConstructor" : false,
287 "type" : "Object/String/Function",
288 "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.",
293 "type" : "String/Object",
294 "desc" : "(optional) The parameters to pass, as either a URL encoded string \"param1=1&param2=2\" or an object {param1: 1, param2: 2}",
300 "desc" : "(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)",
304 "name" : "discardUrl",
306 "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.",
315 "desc" : "Filter the data by a specific property.",
316 "sig" : "(property, value)",
320 "isConstructor" : false,
332 "desc" : "A property on your JSON objects",
337 "type" : "String/RegExp",
338 "desc" : "Either string that the property values\nshould start with, or a RegExp to test against the property",
345 "name" : "getSelectedNodes",
347 "desc" : "Get the currently selected nodes.",
348 "sig" : "()\n{\n\n}",
350 "memberOf" : "Roo.View",
352 "isConstructor" : false,
365 "desc" : "An array of HTMLElements"
372 "desc" : "Gets a range template nodes.",
373 "sig" : "(startIndex, endIndex)",
375 "memberOf" : "Roo.View",
377 "isConstructor" : false,
387 "name" : "startIndex",
403 "desc" : "An array of nodes"
410 "desc" : "Selects nodes.",
411 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
413 "memberOf" : "Roo.View",
415 "isConstructor" : false,
426 "type" : "Array/HTMLElement/String/Number",
427 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
431 "name" : "keepExisting",
433 "desc" : "(optional) true to keep existing selections",
437 "name" : "suppressEvent",
439 "desc" : "(optional) true to skip firing of the selectionchange vent",
446 "name" : "clearSelections",
448 "desc" : "Clear all selections",
449 "sig" : "(suppressEvent)",
451 "memberOf" : "Roo.View",
453 "isConstructor" : false,
463 "name" : "suppressEvent",
465 "desc" : "(optional) true to skip firing of the selectionchange event",
472 "name" : "isSelected",
474 "desc" : "Returns true if the passed node is selected",
477 "memberOf" : "Roo.View",
479 "isConstructor" : false,
490 "type" : "HTMLElement/Number",
491 "desc" : "The node or node index",
504 "name" : "onBeforeLoad",
506 "desc" : "onbeforeLoad - masks the loading area.",
507 "sig" : "()\n{\n\n}",
509 "memberOf" : "Roo.View",
511 "isConstructor" : false,
523 "name" : "getSelectedIndexes",
525 "desc" : "Get the indexes of the selected nodes.",
526 "sig" : "()\n{\n\n}",
528 "memberOf" : "Roo.View",
530 "isConstructor" : false,
550 "desc" : "Finds the index of the passed node",
551 "sig" : "(nodeInfo)",
553 "memberOf" : "Roo.View",
555 "isConstructor" : false,
566 "type" : "HTMLElement/String/Number",
567 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
575 "desc" : "The index of the node or -1"
582 "desc" : "Returns the element this view is bound to.",
583 "sig" : "()\n{\n\n}",
585 "memberOf" : "Roo.View",
587 "isConstructor" : false,
599 "type" : "Roo.Element",
607 "desc" : "Changes the data store this view uses and refresh the view.",
610 "memberOf" : "Roo.View",
612 "isConstructor" : false,
631 "name" : "refreshNode",
633 "desc" : "Refresh an individual node.",
636 "memberOf" : "Roo.View",
638 "isConstructor" : false,
657 "name" : "prepareData",
659 "desc" : "Function to override to reformat the data that is sent to\nthe template for each node.\nDEPRICATED - use the preparedata event handler.",
662 "memberOf" : "Roo.View",
664 "isConstructor" : false,
675 "type" : "Array/Object",
676 "desc" : "The raw data (array of colData for a data model bound view or\na JSON object for an UpdateManager bound view).",
683 "name" : "getSelectionCount",
685 "desc" : "Get the number of selected nodes.",
686 "sig" : "()\n{\n\n}",
688 "memberOf" : "Roo.View",
690 "isConstructor" : false,
708 "name" : "findItemFromChild",
710 "desc" : "Returns the template node the passed child belongs to or null if it doesn't belong to one.",
713 "memberOf" : "Roo.View",
715 "isConstructor" : false,
726 "type" : "HTMLElement",
734 "type" : "HTMLElement",
735 "desc" : "The template node"
742 "desc" : "Unselects nodes.",
743 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
745 "memberOf" : "Roo.View",
747 "isConstructor" : false,
758 "type" : "Array/HTMLElement/String/Number",
759 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
763 "name" : "keepExisting",
765 "desc" : "(optional) true IGNORED (for campatibility with select)",
769 "name" : "suppressEvent",
771 "desc" : "(optional) true to skip firing of the selectionchange vent",
780 "desc" : "Gets a template node.",
781 "sig" : "(nodeInfo)",
783 "memberOf" : "Roo.View",
785 "isConstructor" : false,
796 "type" : "HTMLElement/String/Number",
797 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
804 "type" : "HTMLElement",
805 "desc" : "The node or null if it wasn't found"
810 "name" : "purgeListeners",
812 "desc" : "Removes all listeners for this object",
813 "sig" : "()\n{\n\n}",
815 "memberOf" : "Roo.util.Observable",
817 "isConstructor" : false,
831 "desc" : "Appends an event handler to this element (shorthand for addListener)",
832 "sig" : "(eventName, handler, scope, options)",
834 "memberOf" : "Roo.util.Observable",
836 "isConstructor" : false,
846 "name" : "eventName",
848 "desc" : "The type of event to listen for",
854 "desc" : "The method the event invokes",
860 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
866 "desc" : "(optional)",
875 "desc" : "Removes a listener (shorthand for removeListener)",
876 "sig" : "(eventName, handler, scope)",
878 "memberOf" : "Roo.util.Observable",
880 "isConstructor" : false,
890 "name" : "eventName",
892 "desc" : "The type of event to listen for",
898 "desc" : "The handler to remove",
904 "desc" : "(optional) The scope (this object) for the handler",
911 "name" : "addEvents",
913 "desc" : "Used to define events on this Observable",
916 "memberOf" : "Roo.util.Observable",
918 "isConstructor" : false,
930 "desc" : "The object with the events defined",
937 "name" : "releaseCapture",
939 "desc" : "Removes <b>all</b> added captures from the Observable.",
942 "memberOf" : "Roo.util.Observable",
944 "isConstructor" : false,
955 "type" : "Observable",
956 "desc" : "The Observable to release",
963 "name" : "removeListener",
965 "desc" : "Removes a listener",
966 "sig" : "(eventName, handler, scope)",
968 "memberOf" : "Roo.util.Observable",
970 "isConstructor" : false,
980 "name" : "eventName",
982 "desc" : "The type of event to listen for",
988 "desc" : "The handler to remove",
994 "desc" : "(optional) The scope (this object) for the handler",
1001 "name" : "fireEvent",
1002 "type" : "function",
1003 "desc" : "Fires the specified event with the passed parameters (minus the event name).",
1004 "sig" : "(eventName, args)",
1006 "memberOf" : "Roo.util.Observable",
1008 "isConstructor" : false,
1009 "isPrivate" : false,
1018 "name" : "eventName",
1021 "isOptional" : false
1025 "type" : "Object...",
1026 "desc" : "Variable number of parameters are passed to handlers",
1027 "isOptional" : false
1034 "desc" : "returns false if any of the handlers return false otherwise it returns true"
1039 "name" : "hasListener",
1040 "type" : "function",
1041 "desc" : "Checks to see if this object has any listeners for a specified event",
1042 "sig" : "(eventName)",
1044 "memberOf" : "Roo.util.Observable",
1046 "isConstructor" : false,
1047 "isPrivate" : false,
1056 "name" : "eventName",
1058 "desc" : "The name of the event to check for",
1059 "isOptional" : false
1066 "desc" : "True if the event is being listened for, else false"
1072 "type" : "function",
1073 "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.",
1074 "sig" : "(o, fn, scope)",
1076 "memberOf" : "Roo.util.Observable",
1078 "isConstructor" : false,
1079 "isPrivate" : false,
1089 "type" : "Observable",
1090 "desc" : "The Observable to capture",
1091 "isOptional" : false
1095 "type" : "Function",
1096 "desc" : "The function to call",
1097 "isOptional" : false
1102 "desc" : "(optional) The scope (this object) for the fn",
1103 "isOptional" : false
1109 "name" : "addListener",
1110 "type" : "function",
1111 "desc" : "Appends an event handler to this component",
1112 "sig" : "(eventName, handler, scope, options)",
1114 "memberOf" : "Roo.util.Observable",
1116 "isConstructor" : false,
1117 "isPrivate" : false,
1126 "name" : "eventName",
1128 "desc" : "The type of event to listen for",
1129 "isOptional" : false
1133 "type" : "Function",
1134 "desc" : "The method the event invokes",
1135 "isOptional" : false
1140 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
1141 "isOptional" : false
1146 "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>",
1147 "isOptional" : false
1155 "name" : "loadexception",
1156 "type" : "function",
1157 "desc" : "Fires when loading fails.",
1158 "sig" : "function (_self, response)\n{\n\n}",
1167 "type" : "Roo.JsonView",
1169 "isOptional" : false
1172 "name" : "response",
1174 "desc" : "The raw Connect response object",
1175 "isOptional" : false
1182 "type" : "function",
1183 "desc" : "Fires when data is loaded.",
1184 "sig" : "function (_self, data, response)\n{\n\n}",
1193 "type" : "Roo.JsonView",
1195 "isOptional" : false
1200 "desc" : "The JSON data loaded",
1201 "isOptional" : false
1204 "name" : "response",
1206 "desc" : "The raw Connect response object",
1207 "isOptional" : false
1213 "name" : "beforerender",
1214 "type" : "function",
1215 "desc" : "Fires before rendering of the downloaded JSON data.",
1216 "sig" : "function (_self, data)\n{\n\n}",
1225 "type" : "Roo.JsonView",
1227 "isOptional" : false
1232 "desc" : "The JSON data loaded",
1233 "isOptional" : false
1239 "name" : "dblclick",
1240 "type" : "function",
1241 "desc" : "Fires when a template node is double clicked.",
1242 "sig" : "function (_self, index, node, e)\n{\n\n}",
1243 "memberOf" : "Roo.View",
1251 "type" : "Roo.View",
1253 "isOptional" : false
1258 "desc" : "The index of the target node",
1259 "isOptional" : false
1263 "type" : "HTMLElement",
1264 "desc" : "The target node",
1265 "isOptional" : false
1269 "type" : "Roo.EventObject",
1270 "desc" : "The raw event object",
1271 "isOptional" : false
1277 "name" : "preparedata",
1278 "type" : "function",
1279 "desc" : "Fires on every row to render, to allow you to change the data.",
1280 "sig" : "function (_self, data)\n{\n\n}",
1281 "memberOf" : "Roo.View",
1289 "type" : "Roo.View",
1291 "isOptional" : false
1296 "desc" : "to be rendered (change this)",
1297 "isOptional" : false
1303 "name" : "selectionchange",
1304 "type" : "function",
1305 "desc" : "Fires when the selected nodes change.",
1306 "sig" : "function (_self, selections)\n{\n\n}",
1307 "memberOf" : "Roo.View",
1315 "type" : "Roo.View",
1317 "isOptional" : false
1320 "name" : "selections",
1322 "desc" : "Array of the selected nodes",
1323 "isOptional" : false
1329 "name" : "beforeselect",
1330 "type" : "function",
1331 "desc" : "Fires before a selection is made. If any handlers return false, the selection is cancelled.",
1332 "sig" : "function (_self, node, selections)\n{\n\n}",
1333 "memberOf" : "Roo.View",
1341 "type" : "Roo.View",
1343 "isOptional" : false
1347 "type" : "HTMLElement",
1348 "desc" : "The node to be selected",
1349 "isOptional" : false
1352 "name" : "selections",
1354 "desc" : "Array of currently selected nodes",
1355 "isOptional" : false
1361 "name" : "beforeclick",
1362 "type" : "function",
1363 "desc" : "Fires before a click is processed. Returns false to cancel the default action.",
1364 "sig" : "function (_self, index, node, e)\n{\n\n}",
1365 "memberOf" : "Roo.View",
1373 "type" : "Roo.View",
1375 "isOptional" : false
1380 "desc" : "The index of the target node",
1381 "isOptional" : false
1385 "type" : "HTMLElement",
1386 "desc" : "The target node",
1387 "isOptional" : false
1391 "type" : "Roo.EventObject",
1392 "desc" : "The raw event object",
1393 "isOptional" : false
1400 "type" : "function",
1401 "desc" : "Fires when a template node is clicked.",
1402 "sig" : "function (_self, index, node, e)\n{\n\n}",
1403 "memberOf" : "Roo.View",
1411 "type" : "Roo.View",
1413 "isOptional" : false
1418 "desc" : "The index of the target node",
1419 "isOptional" : false
1423 "type" : "HTMLElement",
1424 "desc" : "The target node",
1425 "isOptional" : false
1429 "type" : "Roo.EventObject",
1430 "desc" : "The raw event object",
1431 "isOptional" : false
1437 "name" : "contextmenu",
1438 "type" : "function",
1439 "desc" : "Fires when a template node is right clicked.",
1440 "sig" : "function (_self, index, node, e)\n{\n\n}",
1441 "memberOf" : "Roo.View",
1449 "type" : "Roo.View",
1451 "isOptional" : false
1456 "desc" : "The index of the target node",
1457 "isOptional" : false
1461 "type" : "HTMLElement",
1462 "desc" : "The target node",
1463 "isOptional" : false
1467 "type" : "Roo.EventObject",
1468 "desc" : "The raw event object",
1469 "isOptional" : false