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"
42 "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>",
43 "memberOf" : "Roo.util.Observable"
48 "desc" : "the named area of the template to use as the data area\n Works with domtemplates roo-name=\"name\"",
49 "memberOf" : "Roo.View"
54 "desc" : "to display on mask (default Loading)",
55 "memberOf" : "Roo.View"
58 "name" : "multiSelect",
60 "desc" : "Allow multiple selection",
61 "memberOf" : "Roo.View"
66 "desc" : "The empty text to show when nothing is loaded.",
67 "memberOf" : "Roo.View"
71 "type" : "Roo.data.Store",
72 "desc" : "Data store to load data from.",
73 "memberOf" : "Roo.View"
76 "name" : "toggleSelect",
78 "desc" : "- selecting",
79 "memberOf" : "Roo.View"
82 "name" : "singleSelect",
84 "desc" : "Allow single selection",
85 "memberOf" : "Roo.View"
90 "desc" : "- selecting",
91 "memberOf" : "Roo.View"
95 "type" : "String|Roo.Element",
96 "desc" : "The container element.",
97 "memberOf" : "Roo.View"
101 "type" : "String|Roo.Template",
102 "desc" : "The template used by this View",
103 "memberOf" : "Roo.View"
108 "name" : "getNodeData",
110 "desc" : "Returns the JSON object for the specified node(s)",
115 "isConstructor" : false,
126 "type" : "HTMLElement/Array",
127 "desc" : "The node or an array of nodes",
134 "type" : "Object/Array",
135 "desc" : "If you pass in an array, you get an array back, otherwise\nyou get the JSON object for the node"
142 "desc" : "Get the number of records in the current JSON dataset",
143 "sig" : "()\n{\n\n}",
147 "isConstructor" : false,
167 "desc" : "Sorts the data for this view and refreshes it.",
168 "sig" : "(property, direction, sortType)",
172 "isConstructor" : false,
184 "desc" : "A property on your JSON objects to sort on",
188 "name" : "direction",
190 "desc" : "(optional) \"desc\" or \"asc\" (defaults to \"asc\")",
196 "desc" : "(optional) A function to call to convert the data to a sortable value.",
205 "desc" : "Refreshes the view.",
206 "sig" : "()\n{\n\n}",
210 "isConstructor" : false,
224 "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.",
225 "sig" : "(fn, scope)",
229 "isConstructor" : false,
247 "desc" : "(optional) The scope of the function (defaults to this JsonView)",
254 "name" : "clearFilter",
256 "desc" : "Clears the current filter.",
257 "sig" : "()\n{\n\n}",
261 "isConstructor" : false,
275 "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.",
276 "sig" : "(url, params, callback, discardUrl)",
280 "isConstructor" : false,
291 "type" : "Object/String/Function",
292 "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.",
297 "type" : "String/Object",
298 "desc" : "(optional) The parameters to pass, as either a URL encoded string \"param1=1&param2=2\" or an object {param1: 1, param2: 2}",
304 "desc" : "(optional) Callback when transaction is complete - called with signature (oElement, bSuccess)",
308 "name" : "discardUrl",
310 "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.",
319 "desc" : "Filter the data by a specific property.",
320 "sig" : "(property, value)",
324 "isConstructor" : false,
336 "desc" : "A property on your JSON objects",
341 "type" : "String/RegExp",
342 "desc" : "Either string that the property values\nshould start with, or a RegExp to test against the property",
349 "name" : "getSelectedNodes",
351 "desc" : "Get the currently selected nodes.",
352 "sig" : "()\n{\n\n}",
354 "memberOf" : "Roo.View",
356 "isConstructor" : false,
369 "desc" : "An array of HTMLElements"
376 "desc" : "Gets a range template nodes.",
377 "sig" : "(startIndex, endIndex)",
379 "memberOf" : "Roo.View",
381 "isConstructor" : false,
391 "name" : "startIndex",
407 "desc" : "An array of nodes"
414 "desc" : "Selects nodes.",
415 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
417 "memberOf" : "Roo.View",
419 "isConstructor" : false,
430 "type" : "Array/HTMLElement/String/Number",
431 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
435 "name" : "keepExisting",
437 "desc" : "(optional) true to keep existing selections",
441 "name" : "suppressEvent",
443 "desc" : "(optional) true to skip firing of the selectionchange vent",
450 "name" : "clearSelections",
452 "desc" : "Clear all selections",
453 "sig" : "(suppressEvent)",
455 "memberOf" : "Roo.View",
457 "isConstructor" : false,
467 "name" : "suppressEvent",
469 "desc" : "(optional) true to skip firing of the selectionchange event",
476 "name" : "isSelected",
478 "desc" : "Returns true if the passed node is selected",
481 "memberOf" : "Roo.View",
483 "isConstructor" : false,
494 "type" : "HTMLElement/Number",
495 "desc" : "The node or node index",
508 "name" : "onBeforeLoad",
510 "desc" : "onbeforeLoad - masks the loading area.",
511 "sig" : "()\n{\n\n}",
513 "memberOf" : "Roo.View",
515 "isConstructor" : false,
527 "name" : "getSelectedIndexes",
529 "desc" : "Get the indexes of the selected nodes.",
530 "sig" : "()\n{\n\n}",
532 "memberOf" : "Roo.View",
534 "isConstructor" : false,
554 "desc" : "Finds the index of the passed node",
555 "sig" : "(nodeInfo)",
557 "memberOf" : "Roo.View",
559 "isConstructor" : false,
570 "type" : "HTMLElement/String/Number",
571 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
579 "desc" : "The index of the node or -1"
586 "desc" : "Returns the element this view is bound to.",
587 "sig" : "()\n{\n\n}",
589 "memberOf" : "Roo.View",
591 "isConstructor" : false,
603 "type" : "Roo.Element",
611 "desc" : "Changes the data store this view uses and refresh the view.",
614 "memberOf" : "Roo.View",
616 "isConstructor" : false,
635 "name" : "refreshNode",
637 "desc" : "Refresh an individual node.",
640 "memberOf" : "Roo.View",
642 "isConstructor" : false,
661 "name" : "prepareData",
663 "desc" : "Function to override to reformat the data that is sent to\nthe template for each node.\nDEPRICATED - use the preparedata event handler.",
666 "memberOf" : "Roo.View",
668 "isConstructor" : false,
679 "type" : "Array/Object",
680 "desc" : "The raw data (array of colData for a data model bound view or\na JSON object for an UpdateManager bound view).",
687 "name" : "getSelectionCount",
689 "desc" : "Get the number of selected nodes.",
690 "sig" : "()\n{\n\n}",
692 "memberOf" : "Roo.View",
694 "isConstructor" : false,
712 "name" : "findItemFromChild",
714 "desc" : "Returns the template node the passed child belongs to or null if it doesn't belong to one.",
717 "memberOf" : "Roo.View",
719 "isConstructor" : false,
730 "type" : "HTMLElement",
738 "type" : "HTMLElement",
739 "desc" : "The template node"
746 "desc" : "Unselects nodes.",
747 "sig" : "(nodeInfo, keepExisting, suppressEvent)",
749 "memberOf" : "Roo.View",
751 "isConstructor" : false,
762 "type" : "Array/HTMLElement/String/Number",
763 "desc" : "An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select",
767 "name" : "keepExisting",
769 "desc" : "(optional) true IGNORED (for campatibility with select)",
773 "name" : "suppressEvent",
775 "desc" : "(optional) true to skip firing of the selectionchange vent",
784 "desc" : "Gets a template node.",
785 "sig" : "(nodeInfo)",
787 "memberOf" : "Roo.View",
789 "isConstructor" : false,
800 "type" : "HTMLElement/String/Number",
801 "desc" : "An HTMLElement template node, index of a template node or the id of a template node",
808 "type" : "HTMLElement",
809 "desc" : "The node or null if it wasn't found"
814 "name" : "purgeListeners",
816 "desc" : "Removes all listeners for this object",
817 "sig" : "()\n{\n\n}",
819 "memberOf" : "Roo.util.Observable",
821 "isConstructor" : false,
835 "desc" : "Appends an event handler to this element (shorthand for addListener)",
836 "sig" : "(eventName, handler, scope, options)",
838 "memberOf" : "Roo.util.Observable",
840 "isConstructor" : false,
850 "name" : "eventName",
852 "desc" : "The type of event to listen for",
858 "desc" : "The method the event invokes",
864 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
870 "desc" : "(optional)",
879 "desc" : "Removes a listener (shorthand for removeListener)",
880 "sig" : "(eventName, handler, scope)",
882 "memberOf" : "Roo.util.Observable",
884 "isConstructor" : false,
894 "name" : "eventName",
896 "desc" : "The type of event to listen for",
902 "desc" : "The handler to remove",
908 "desc" : "(optional) The scope (this object) for the handler",
915 "name" : "addEvents",
917 "desc" : "Used to define events on this Observable",
920 "memberOf" : "Roo.util.Observable",
922 "isConstructor" : false,
934 "desc" : "The object with the events defined",
941 "name" : "releaseCapture",
943 "desc" : "Removes <b>all</b> added captures from the Observable.",
946 "memberOf" : "Roo.util.Observable",
948 "isConstructor" : false,
959 "type" : "Observable",
960 "desc" : "The Observable to release",
967 "name" : "removeListener",
969 "desc" : "Removes a listener",
970 "sig" : "(eventName, handler, scope)",
972 "memberOf" : "Roo.util.Observable",
974 "isConstructor" : false,
984 "name" : "eventName",
986 "desc" : "The type of event to listen for",
992 "desc" : "The handler to remove",
998 "desc" : "(optional) The scope (this object) for the handler",
1005 "name" : "fireEvent",
1006 "type" : "function",
1007 "desc" : "Fires the specified event with the passed parameters (minus the event name).",
1008 "sig" : "(eventName, args)",
1010 "memberOf" : "Roo.util.Observable",
1012 "isConstructor" : false,
1013 "isPrivate" : false,
1022 "name" : "eventName",
1025 "isOptional" : false
1029 "type" : "Object...",
1030 "desc" : "Variable number of parameters are passed to handlers",
1031 "isOptional" : false
1038 "desc" : "returns false if any of the handlers return false otherwise it returns true"
1043 "name" : "hasListener",
1044 "type" : "function",
1045 "desc" : "Checks to see if this object has any listeners for a specified event",
1046 "sig" : "(eventName)",
1048 "memberOf" : "Roo.util.Observable",
1050 "isConstructor" : false,
1051 "isPrivate" : false,
1060 "name" : "eventName",
1062 "desc" : "The name of the event to check for",
1063 "isOptional" : false
1070 "desc" : "True if the event is being listened for, else false"
1076 "type" : "function",
1077 "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.",
1078 "sig" : "(o, fn, scope)",
1080 "memberOf" : "Roo.util.Observable",
1082 "isConstructor" : false,
1083 "isPrivate" : false,
1093 "type" : "Observable",
1094 "desc" : "The Observable to capture",
1095 "isOptional" : false
1099 "type" : "Function",
1100 "desc" : "The function to call",
1101 "isOptional" : false
1106 "desc" : "(optional) The scope (this object) for the fn",
1107 "isOptional" : false
1113 "name" : "addListener",
1114 "type" : "function",
1115 "desc" : "Appends an event handler to this component",
1116 "sig" : "(eventName, handler, scope, options)",
1118 "memberOf" : "Roo.util.Observable",
1120 "isConstructor" : false,
1121 "isPrivate" : false,
1130 "name" : "eventName",
1132 "desc" : "The type of event to listen for",
1133 "isOptional" : false
1137 "type" : "Function",
1138 "desc" : "The method the event invokes",
1139 "isOptional" : false
1144 "desc" : "(optional) The scope in which to execute the handler\nfunction. The handler function's \"this\" context.",
1145 "isOptional" : false
1150 "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>",
1151 "isOptional" : false
1159 "name" : "loadexception",
1160 "type" : "function",
1161 "desc" : "Fires when loading fails.",
1162 "sig" : "function (_self, response)\n{\n\n}",
1171 "type" : "Roo.JsonView",
1173 "isOptional" : false
1176 "name" : "response",
1178 "desc" : "The raw Connect response object",
1179 "isOptional" : false
1186 "type" : "function",
1187 "desc" : "Fires when data is loaded.",
1188 "sig" : "function (_self, data, response)\n{\n\n}",
1197 "type" : "Roo.JsonView",
1199 "isOptional" : false
1204 "desc" : "The JSON data loaded",
1205 "isOptional" : false
1208 "name" : "response",
1210 "desc" : "The raw Connect response object",
1211 "isOptional" : false
1217 "name" : "beforerender",
1218 "type" : "function",
1219 "desc" : "Fires before rendering of the downloaded JSON data.",
1220 "sig" : "function (_self, data)\n{\n\n}",
1229 "type" : "Roo.JsonView",
1231 "isOptional" : false
1236 "desc" : "The JSON data loaded",
1237 "isOptional" : false
1243 "name" : "dblclick",
1244 "type" : "function",
1245 "desc" : "Fires when a template node is double clicked.",
1246 "sig" : "function (_self, index, node, e)\n{\n\n}",
1247 "memberOf" : "Roo.View",
1255 "type" : "Roo.View",
1257 "isOptional" : false
1262 "desc" : "The index of the target node",
1263 "isOptional" : false
1267 "type" : "HTMLElement",
1268 "desc" : "The target node",
1269 "isOptional" : false
1273 "type" : "Roo.EventObject",
1274 "desc" : "The raw event object",
1275 "isOptional" : false
1281 "name" : "preparedata",
1282 "type" : "function",
1283 "desc" : "Fires on every row to render, to allow you to change the data.",
1284 "sig" : "function (_self, data)\n{\n\n}",
1285 "memberOf" : "Roo.View",
1293 "type" : "Roo.View",
1295 "isOptional" : false
1300 "desc" : "to be rendered (change this)",
1301 "isOptional" : false
1307 "name" : "selectionchange",
1308 "type" : "function",
1309 "desc" : "Fires when the selected nodes change.",
1310 "sig" : "function (_self, selections)\n{\n\n}",
1311 "memberOf" : "Roo.View",
1319 "type" : "Roo.View",
1321 "isOptional" : false
1324 "name" : "selections",
1326 "desc" : "Array of the selected nodes",
1327 "isOptional" : false
1333 "name" : "beforeselect",
1334 "type" : "function",
1335 "desc" : "Fires before a selection is made. If any handlers return false, the selection is cancelled.",
1336 "sig" : "function (_self, node, selections)\n{\n\n}",
1337 "memberOf" : "Roo.View",
1345 "type" : "Roo.View",
1347 "isOptional" : false
1351 "type" : "HTMLElement",
1352 "desc" : "The node to be selected",
1353 "isOptional" : false
1356 "name" : "selections",
1358 "desc" : "Array of currently selected nodes",
1359 "isOptional" : false
1365 "name" : "beforeclick",
1366 "type" : "function",
1367 "desc" : "Fires before a click is processed. Returns false to cancel the default action.",
1368 "sig" : "function (_self, index, node, e)\n{\n\n}",
1369 "memberOf" : "Roo.View",
1377 "type" : "Roo.View",
1379 "isOptional" : false
1384 "desc" : "The index of the target node",
1385 "isOptional" : false
1389 "type" : "HTMLElement",
1390 "desc" : "The target node",
1391 "isOptional" : false
1395 "type" : "Roo.EventObject",
1396 "desc" : "The raw event object",
1397 "isOptional" : false
1404 "type" : "function",
1405 "desc" : "Fires when a template node is clicked.",
1406 "sig" : "function (_self, index, node, e)\n{\n\n}",
1407 "memberOf" : "Roo.View",
1415 "type" : "Roo.View",
1417 "isOptional" : false
1422 "desc" : "The index of the target node",
1423 "isOptional" : false
1427 "type" : "HTMLElement",
1428 "desc" : "The target node",
1429 "isOptional" : false
1433 "type" : "Roo.EventObject",
1434 "desc" : "The raw event object",
1435 "isOptional" : false
1441 "name" : "contextmenu",
1442 "type" : "function",
1443 "desc" : "Fires when a template node is right clicked.",
1444 "sig" : "function (_self, index, node, e)\n{\n\n}",
1445 "memberOf" : "Roo.View",
1453 "type" : "Roo.View",
1455 "isOptional" : false
1460 "desc" : "The index of the target node",
1461 "isOptional" : false
1465 "type" : "HTMLElement",
1466 "desc" : "The target node",
1467 "isOptional" : false
1471 "type" : "Roo.EventObject",
1472 "desc" : "The raw event object",
1473 "isOptional" : false