add support for onLoad on template
authorAlan Knowles <alan@roojs.com>
Thu, 4 Mar 2021 07:48:34 +0000 (15:48 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 4 Mar 2021 07:48:34 +0000 (15:48 +0800)
docs/json/roodata.json
docs/src/Roo_Template.js.html
docs/symbols/Roo.DomTemplate.json
docs/symbols/Roo.MasterTemplate.json
docs/symbols/Roo.Template.json
docs/symbols/Roo.XTemplate.json

index f5120a9..b51fc0f 100644 (file)
         "desc" : "The HTML fragment or an array of fragments to join(\"\") or multiple arguments to join(\"\")",
         "memberOf" : "Roo.Template"
       },
+      {
+        "name" : "onLoad",
+        "type" : "Function",
+        "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
+        "memberOf" : "Roo.Template"
+      },
       {
         "name" : "url",
         "type" : "String",
         "desc" : "The HTML fragment or an array of fragments to join(\"\") or multiple arguments to join(\"\")",
         "memberOf" : "Roo.Template"
       },
+      {
+        "name" : "onLoad",
+        "type" : "Function",
+        "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
+        "memberOf" : "Roo.Template"
+      },
       {
         "name" : "url",
         "type" : "String",
         "desc" : "The HTML fragment or an array of fragments to join(\"\") or multiple arguments to join(\"\")",
         "memberOf" : ""
       },
+      {
+        "name" : "onLoad",
+        "type" : "Function",
+        "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
+        "memberOf" : ""
+      },
       {
         "name" : "url",
         "type" : "String",
         "desc" : "The HTML fragment or an array of fragments to join(\"\") or multiple arguments to join(\"\")",
         "memberOf" : "Roo.Template"
       },
+      {
+        "name" : "onLoad",
+        "type" : "Function",
+        "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
+        "memberOf" : "Roo.Template"
+      },
       {
         "name" : "url",
         "type" : "String",
index 916144f..899b4c0 100644 (file)
@@ -53,6 +53,12 @@ t.append('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'}
 };
 </span><span class="jsdoc-var">Roo.Template.prototype </span><span class="jsdoc-syntax">= {
 
+    </span><span class="jsdoc-comment">/**
+     * @cfg {Function} onLoad Called after the template has been loaded and complied (usually from a remove source)
+     */
+    </span><span class="jsdoc-var">onLoad </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">,
+
+
     </span><span class="jsdoc-comment">/**
      * @cfg {String} url  The Url to load the template from. beware if you are loading from a url, the data may not be ready if you use it instantly..
      *                    it should be fixed so that template is observable...
@@ -130,6 +136,9 @@ t.append('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'}
                 </span><span class="jsdoc-var">_t.html </span><span class="jsdoc-syntax">= </span><span class="jsdoc-var">response.responseText</span><span class="jsdoc-syntax">;
                 </span><span class="jsdoc-var">_t.url </span><span class="jsdoc-syntax">= </span><span class="jsdoc-keyword">false</span><span class="jsdoc-syntax">;
                 </span><span class="jsdoc-var">_t.compile</span><span class="jsdoc-syntax">();
+                </span><span class="jsdoc-keyword">if </span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">_t.onLoad</span><span class="jsdoc-syntax">) {
+                    </span><span class="jsdoc-var">_t.onload</span><span class="jsdoc-syntax">();
+                }
              },
             </span><span class="jsdoc-var">failure </span><span class="jsdoc-syntax">: </span><span class="jsdoc-keyword">function</span><span class="jsdoc-syntax">(</span><span class="jsdoc-var">response</span><span class="jsdoc-syntax">) {
                 </span><span class="jsdoc-var">Roo.log</span><span class="jsdoc-syntax">(</span><span class="jsdoc-string">&quot;Template failed to load from &quot; </span><span class="jsdoc-syntax">+ </span><span class="jsdoc-var">_t.url</span><span class="jsdoc-syntax">);
index 5bff0fa..bfd0e5d 100644 (file)
   "params" : [],
   "returns" : [],
   "config" : [
+    {
+      "name" : "onLoad",
+      "type" : "Function",
+      "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
+      "memberOf" : "Roo.Template",
+      "optvals" : []
+    },
     {
       "name" : "html",
       "type" : "String",
index a93ee10..9c86f91 100644 (file)
   "params" : [],
   "returns" : [],
   "config" : [
+    {
+      "name" : "onLoad",
+      "type" : "Function",
+      "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
+      "memberOf" : "Roo.Template",
+      "optvals" : []
+    },
     {
       "name" : "html",
       "type" : "String",
index d1c4cce..df4aa66 100644 (file)
   ],
   "returns" : [],
   "config" : [
+    {
+      "name" : "onLoad",
+      "type" : "Function",
+      "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
+      "memberOf" : "Roo.Template",
+      "optvals" : []
+    },
     {
       "name" : "html",
       "type" : "String",
index 51afaaf..d7f671f 100644 (file)
   "params" : [],
   "returns" : [],
   "config" : [
+    {
+      "name" : "onLoad",
+      "type" : "Function",
+      "desc" : "Called after the template has been loaded and complied (usually from a remove source)",
+      "memberOf" : "Roo.Template",
+      "optvals" : []
+    },
     {
       "name" : "html",
       "type" : "String",