2 "name" : "Roo.JsonView",
10 "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 "isSingleton" : false,
15 "isBuilderTop" : false,
16 "memberOf" : "JsonView",
25 "desc" : "The config object",
34 "name" : "selectedClass",
36 "desc" : "The css class to add to selected nodes",
37 "memberOf" : "Roo.View",
44 "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>",
45 "memberOf" : "Roo.util.Observable",
52 "desc" : "the named area of the template to use as the data area\n Works with domtemplates roo-name=\"name\"",
53 "memberOf" : "Roo.View",
60 "desc" : "to display on mask (default Loading)",
61 "memberOf" : "Roo.View",
66 "name" : "multiSelect",
68 "desc" : "Allow multiple selection",
69 "memberOf" : "Roo.View",
76 "desc" : "The empty text to show when nothing is loaded.",
77 "memberOf" : "Roo.View",
83 "type" : "Roo.data.Store",
84 "desc" : "Data store to load data from.",
85 "memberOf" : "Roo.View",
90 "name" : "toggleSelect",
92 "desc" : "- selecting",
93 "memberOf" : "Roo.View",
98 "name" : "singleSelect",
100 "desc" : "Allow single selection",
101 "memberOf" : "Roo.View",
102 "isOptional" : false,
108 "desc" : "- selecting",
109 "memberOf" : "Roo.View",
110 "isOptional" : false,
115 "type" : "String|Roo.Element",
116 "desc" : "The container element.",
117 "memberOf" : "Roo.View",
118 "isOptional" : false,
123 "type" : "String|Roo.Template",
124 "desc" : "The template used by this View",
125 "memberOf" : "Roo.View",
126 "isOptional" : false,
132 "name" : "getNodeData",
134 "desc" : "Returns the JSON object for the specified node(s)",
139 "isConstructor" : false,
150 "type" : "HTMLElement/Array",
151 "desc" : "The node or an array of nodes",
158 "type" : "Object/Array",
159 "desc" : "If you pass in an array, you get an array back, otherwise\nyou get the JSON object for the node"
166 "desc" : "Get the number of records in the current JSON dataset",
167 "sig" : "()\n{\n\n}",
171 "isConstructor" : false,
191 "desc" : "Sorts the data for this view and refreshes it.",
192 "sig" : "(property, direction, sortType)",
196 "isConstructor" : false,
208 "desc" : "A property on your JSON objects to sort on",
212 "name" : "direction",
214 "desc" : "(optional) \"desc\" or \"asc\" (defaults to \"asc\")",
220 "desc" : "(optional) A function to call to convert the data to a sortable value.",
229 "desc" : "Refreshes the view.",
230 "sig" : "()\n{\n\n}",
234 "isConstructor" : false,
248 "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.",
249 "sig" : "(fn, scope)",
253 "isConstructor" : false,
271 "desc" : "(optional) The scope of the function (defaults to this JsonView)",
278 "name" : "clearFilter",
280 "desc" : "Clears the current filter.",
281 "sig" : "()\n{\n\n}",
285 "isConstructor" : false,
299 "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.",
300 "sig" : "(url, params, callback, discardUrl)",
304 "isConstructor" : false,
315 "type" : "Object/String/Function",
316 "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.",
321 "type" : "String/Object",
322 "desc" : "(optional) The parameters to pass, as either a URL encoded string \"param1=1&param2=2\" or an object {param1: 1, param2: 2}",
328 "desc" : "(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)",
332 "name" : "discardUrl",
334 "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.",
343 "desc" : "Filter the data by a specific property.",
344 "sig" : "(property, value)",
348 "isConstructor" : false,
360 "desc" : "A property on your JSON objects",
365 "type" : "String/RegExp",
366 "desc" : "Either string that the property values\nshould start with, or a RegExp to test against the property",
373 "name" : "getSelectedNodes",
375 "desc" : "Get the currently selected nodes.",
376 "sig" : "()\n{\n\n}",
378 "memberOf" : "Roo.View",
380 "isConstructor" : false,
393 "desc" : "An array of HTMLElements"
400 "desc" : "Gets a range template nodes.",
401 "sig" : "(startIndex, endIndex)",
403 "memberOf" : "Roo.View",
405 "isConstructor" : false,
415 "name" : "startIndex",
431 "desc" : "An array of nodes"
438 "desc" : "Selects nodes.",
439 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
441 "memberOf" : "Roo.View",
443 "isConstructor" : false,
454 "type" : "Array/HTMLElement/String/Number",
455 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
459 "name" : "keepExisting",
461 "desc" : "(optional) true to keep existing selections",
465 "name" : "suppressEvent",
467 "desc" : "(optional) true to skip firing of the selectionchange vent",
474 "name" : "clearSelections",
476 "desc" : "Clear all selections",
477 "sig" : "(suppressEvent)",
479 "memberOf" : "Roo.View",
481 "isConstructor" : false,
491 "name" : "suppressEvent",
493 "desc" : "(optional) true to skip firing of the selectionchange event",
500 "name" : "isSelected",
502 "desc" : "Returns true if the passed node is selected",
505 "memberOf" : "Roo.View",
507 "isConstructor" : false,
518 "type" : "HTMLElement/Number",
519 "desc" : "The node or node index",
532 "name" : "onBeforeLoad",
534 "desc" : "onbeforeLoad - masks the loading area.",
535 "sig" : "()\n{\n\n}",
537 "memberOf" : "Roo.View",
539 "isConstructor" : false,
551 "name" : "getSelectedIndexes",
553 "desc" : "Get the indexes of the selected nodes.",
554 "sig" : "()\n{\n\n}",
556 "memberOf" : "Roo.View",
558 "isConstructor" : false,
578 "desc" : "Finds the index of the passed node",
579 "sig" : "(nodeInfo)",
581 "memberOf" : "Roo.View",
583 "isConstructor" : false,
594 "type" : "HTMLElement/String/Number",
595 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
603 "desc" : "The index of the node or -1"
610 "desc" : "Returns the element this view is bound to.",
611 "sig" : "()\n{\n\n}",
613 "memberOf" : "Roo.View",
615 "isConstructor" : false,
627 "type" : "Roo.Element",
635 "desc" : "Changes the data store this view uses and refresh the view.",
638 "memberOf" : "Roo.View",
640 "isConstructor" : false,
659 "name" : "refreshNode",
661 "desc" : "Refresh an individual node.",
664 "memberOf" : "Roo.View",
666 "isConstructor" : false,
685 "name" : "prepareData",
687 "desc" : "Function to override to reformat the data that is sent to\nthe template for each node.\nDEPRICATED - use the preparedata event handler.",
690 "memberOf" : "Roo.View",
692 "isConstructor" : false,
703 "type" : "Array/Object",
704 "desc" : "The raw data (array of colData for a data model bound view or\na JSON object for an UpdateManager bound view).",
711 "name" : "getSelectionCount",
713 "desc" : "Get the number of selected nodes.",
714 "sig" : "()\n{\n\n}",
716 "memberOf" : "Roo.View",
718 "isConstructor" : false,
736 "name" : "findItemFromChild",
738 "desc" : "Returns the template node the passed child belongs to or null if it doesn't belong to one.",
741 "memberOf" : "Roo.View",
743 "isConstructor" : false,
754 "type" : "HTMLElement",
762 "type" : "HTMLElement",
763 "desc" : "The template node"
770 "desc" : "Unselects nodes.",
771 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
773 "memberOf" : "Roo.View",
775 "isConstructor" : false,
786 "type" : "Array/HTMLElement/String/Number",
787 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
791 "name" : "keepExisting",
793 "desc" : "(optional) true IGNORED (for campatibility with select)",
797 "name" : "suppressEvent",
799 "desc" : "(optional) true to skip firing of the selectionchange vent",
808 "desc" : "Gets a template node.",
809 "sig" : "(nodeInfo)",
811 "memberOf" : "Roo.View",
813 "isConstructor" : false,
824 "type" : "HTMLElement/String/Number",
825 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
832 "type" : "HTMLElement",
833 "desc" : "The node or null if it wasn't found"
838 "name" : "purgeListeners",
840 "desc" : "Removes all listeners for this object",
841 "sig" : "()\n{\n\n}",
843 "memberOf" : "Roo.util.Observable",
845 "isConstructor" : false,
859 "desc" : "Appends an event handler to this element (shorthand for addListener)",
860 "sig" : "(eventName, handler, scope, options)",
862 "memberOf" : "Roo.util.Observable",
864 "isConstructor" : false,
874 "name" : "eventName",
876 "desc" : "The type of event to listen for",
882 "desc" : "The method the event invokes",
888 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
894 "desc" : "(optional)",
903 "desc" : "Removes a listener (shorthand for removeListener)",
904 "sig" : "(eventName, handler, scope)",
906 "memberOf" : "Roo.util.Observable",
908 "isConstructor" : false,
918 "name" : "eventName",
920 "desc" : "The type of event to listen for",
926 "desc" : "The handler to remove",
932 "desc" : "(optional) The scope (this object) for the handler",
939 "name" : "addEvents",
941 "desc" : "Used to define events on this Observable",
944 "memberOf" : "Roo.util.Observable",
946 "isConstructor" : false,
958 "desc" : "The object with the events defined",
965 "name" : "releaseCapture",
967 "desc" : "Removes <b>all</b> added captures from the Observable.",
970 "memberOf" : "Roo.util.Observable",
972 "isConstructor" : false,
983 "type" : "Observable",
984 "desc" : "The Observable to release",
991 "name" : "removeListener",
993 "desc" : "Removes a listener",
994 "sig" : "(eventName, handler, scope)",
996 "memberOf" : "Roo.util.Observable",
998 "isConstructor" : false,
1008 "name" : "eventName",
1010 "desc" : "The type of event to listen for",
1011 "isOptional" : false
1015 "type" : "Function",
1016 "desc" : "The handler to remove",
1017 "isOptional" : false
1022 "desc" : "(optional) The scope (this object) for the handler",
1023 "isOptional" : false
1029 "name" : "fireEvent",
1030 "type" : "function",
1031 "desc" : "Fires the specified event with the passed parameters (minus the event name).",
1032 "sig" : "(eventName, args)",
1034 "memberOf" : "Roo.util.Observable",
1036 "isConstructor" : false,
1037 "isPrivate" : false,
1046 "name" : "eventName",
1049 "isOptional" : false
1053 "type" : "Object...",
1054 "desc" : "Variable number of parameters are passed to handlers",
1055 "isOptional" : false
1062 "desc" : "returns false if any of the handlers return false otherwise it returns true"
1067 "name" : "hasListener",
1068 "type" : "function",
1069 "desc" : "Checks to see if this object has any listeners for a specified event",
1070 "sig" : "(eventName)",
1072 "memberOf" : "Roo.util.Observable",
1074 "isConstructor" : false,
1075 "isPrivate" : false,
1084 "name" : "eventName",
1086 "desc" : "The name of the event to check for",
1087 "isOptional" : false
1094 "desc" : "True if the event is being listened for, else false"
1100 "type" : "function",
1101 "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.",
1102 "sig" : "(o, fn, scope)",
1104 "memberOf" : "Roo.util.Observable",
1106 "isConstructor" : false,
1107 "isPrivate" : false,
1117 "type" : "Observable",
1118 "desc" : "The Observable to capture",
1119 "isOptional" : false
1123 "type" : "Function",
1124 "desc" : "The function to call",
1125 "isOptional" : false
1130 "desc" : "(optional) The scope (this object) for the fn",
1131 "isOptional" : false
1137 "name" : "addListener",
1138 "type" : "function",
1139 "desc" : "Appends an event handler to this component",
1140 "sig" : "(eventName, handler, scope, options)",
1142 "memberOf" : "Roo.util.Observable",
1144 "isConstructor" : false,
1145 "isPrivate" : false,
1154 "name" : "eventName",
1156 "desc" : "The type of event to listen for",
1157 "isOptional" : false
1161 "type" : "Function",
1162 "desc" : "The method the event invokes",
1163 "isOptional" : false
1168 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
1169 "isOptional" : false
1174 "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>",
1175 "isOptional" : false
1183 "name" : "loadexception",
1184 "type" : "function",
1185 "desc" : "Fires when loading fails.",
1186 "sig" : "function (_self, response)\n{\n\n}",
1195 "type" : "Roo.JsonView",
1197 "isOptional" : false
1200 "name" : "response",
1202 "desc" : "The raw Connect response object",
1203 "isOptional" : false
1210 "type" : "function",
1211 "desc" : "Fires when data is loaded.",
1212 "sig" : "function (_self, data, response)\n{\n\n}",
1221 "type" : "Roo.JsonView",
1223 "isOptional" : false
1228 "desc" : "The JSON data loaded",
1229 "isOptional" : false
1232 "name" : "response",
1234 "desc" : "The raw Connect response object",
1235 "isOptional" : false
1241 "name" : "beforerender",
1242 "type" : "function",
1243 "desc" : "Fires before rendering of the downloaded JSON data.",
1244 "sig" : "function (_self, data)\n{\n\n}",
1253 "type" : "Roo.JsonView",
1255 "isOptional" : false
1260 "desc" : "The JSON data loaded",
1261 "isOptional" : false
1267 "name" : "dblclick",
1268 "type" : "function",
1269 "desc" : "Fires when a template node is double clicked.",
1270 "sig" : "function (_self, index, node, e)\n{\n\n}",
1271 "memberOf" : "Roo.View",
1279 "type" : "Roo.View",
1281 "isOptional" : false
1286 "desc" : "The index of the target node",
1287 "isOptional" : false
1291 "type" : "HTMLElement",
1292 "desc" : "The target node",
1293 "isOptional" : false
1297 "type" : "Roo.EventObject",
1298 "desc" : "The raw event object",
1299 "isOptional" : false
1305 "name" : "preparedata",
1306 "type" : "function",
1307 "desc" : "Fires on every row to render, to allow you to change the data.",
1308 "sig" : "function (_self, data)\n{\n\n}",
1309 "memberOf" : "Roo.View",
1317 "type" : "Roo.View",
1319 "isOptional" : false
1324 "desc" : "to be rendered (change this)",
1325 "isOptional" : false
1331 "name" : "selectionchange",
1332 "type" : "function",
1333 "desc" : "Fires when the selected nodes change.",
1334 "sig" : "function (_self, selections)\n{\n\n}",
1335 "memberOf" : "Roo.View",
1343 "type" : "Roo.View",
1345 "isOptional" : false
1348 "name" : "selections",
1350 "desc" : "Array of the selected nodes",
1351 "isOptional" : false
1357 "name" : "beforeselect",
1358 "type" : "function",
1359 "desc" : "Fires before a selection is made. If any handlers return false, the selection is cancelled.",
1360 "sig" : "function (_self, node, selections)\n{\n\n}",
1361 "memberOf" : "Roo.View",
1369 "type" : "Roo.View",
1371 "isOptional" : false
1375 "type" : "HTMLElement",
1376 "desc" : "The node to be selected",
1377 "isOptional" : false
1380 "name" : "selections",
1382 "desc" : "Array of currently selected nodes",
1383 "isOptional" : false
1389 "name" : "beforeclick",
1390 "type" : "function",
1391 "desc" : "Fires before a click is processed. Returns false to cancel the default action.",
1392 "sig" : "function (_self, index, node, e)\n{\n\n}",
1393 "memberOf" : "Roo.View",
1401 "type" : "Roo.View",
1403 "isOptional" : false
1408 "desc" : "The index of the target node",
1409 "isOptional" : false
1413 "type" : "HTMLElement",
1414 "desc" : "The target node",
1415 "isOptional" : false
1419 "type" : "Roo.EventObject",
1420 "desc" : "The raw event object",
1421 "isOptional" : false
1428 "type" : "function",
1429 "desc" : "Fires when a template node is clicked.",
1430 "sig" : "function (_self, index, node, e)\n{\n\n}",
1431 "memberOf" : "Roo.View",
1439 "type" : "Roo.View",
1441 "isOptional" : false
1446 "desc" : "The index of the target node",
1447 "isOptional" : false
1451 "type" : "HTMLElement",
1452 "desc" : "The target node",
1453 "isOptional" : false
1457 "type" : "Roo.EventObject",
1458 "desc" : "The raw event object",
1459 "isOptional" : false
1465 "name" : "contextmenu",
1466 "type" : "function",
1467 "desc" : "Fires when a template node is right clicked.",
1468 "sig" : "function (_self, index, node, e)\n{\n\n}",
1469 "memberOf" : "Roo.View",
1477 "type" : "Roo.View",
1479 "isOptional" : false
1484 "desc" : "The index of the target node",
1485 "isOptional" : false
1489 "type" : "HTMLElement",
1490 "desc" : "The target node",
1491 "isOptional" : false
1495 "type" : "Roo.EventObject",
1496 "desc" : "The raw event object",
1497 "isOptional" : false