partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

Ext.tree.View-missingMethods.js (547B)


      1 /**
      2  * Enhancements for Ext.tree.View:
      3  *
      4  * Ported ensureVisible and scrollIntoView from ExtJS3
      5  */
      6 Ext.define("PartKeepr.tree.View", {
      7     override: "Ext.tree.View",
      8 
      9     /**
     10      * Expands all parent nodes so the child is visible.
     11      * @param {Ext.data.Model} record The record to make visible
     12      */
     13     ensureVisible: function (record)
     14     {
     15         if (!record) {
     16             return;
     17         }
     18 
     19         if (record.parentNode) {
     20             record.parentNode.expand();
     21             this.ensureVisible(record.parentNode);
     22         }
     23     }
     24 });