Results 1 to 6 of 6

Thread: Modern Tree Error When Removing Node Child - WORKAROUND REQUIRED PLEASE!

  1. #1
    Sencha Premium User
    Join Date
    May 2015
    Posts
    166

    Default Modern Tree Error When Removing Node Child - WORKAROUND REQUIRED PLEASE!

    I raised this bug some time ago
    https://fiddle.sencha.com/#fiddle/2k99

    It's rather problematic as it occurs in a few different use cases - the fiddle just demonstrates one of them

    It's recorded as bug EXTJS-27428 and it's quite serious but the "Remains of Sencha" have not seen fit to fix it yet - and possibly never will.

    Any of the Sencha experts on here have a suitable workaround please?

  2. #2
    Sencha Premium User
    Join Date
    May 2015
    Posts
    166

    Default

    Including this override seems to work but I have no idea what other implications it has

    Ext.define(null, {
    override: 'Ext.grid.cell.Tree',


    privates: {
    syncIndent: function () {
    var me = this,
    column = me.getColumn(),
    indentSize, record, depth;
    if (column) {
    indentSize = column._indentSize;
    record = me.getRecord();
    if (!indentSize) {
    column._indentSize = indentSize = parseInt(me.el.getStyle('background-position'), 10);
    }
    // replace this
    // if (record) {
    // with
    if (record && record.getTreeStore()) {
    depth = record.getTreeStore().rootVisible ? record.data.depth : record.data.depth - 1;

    me.indentElement.dom.style.width = (depth * indentSize) + 'px';
    }
    }
    },
    }
    });

  3. #3
    Sencha Premium User
    Join Date
    Jan 2009
    Posts
    466
    Answers
    19

    Default

    Is explicitly removing the node from the tree store an option?


  4. #4
    Sencha Premium User
    Join Date
    May 2015
    Posts
    166

    Default

    I tried that and whilst it solved that particular use case it didn't solve another one!

  5. #5
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,250
    Answers
    758

    Default

    Checking if the store exists or not is reasonable. The grid row is being returned to the pool of rows. So even if a record is attached at that point, assuming that it also has a related store is questionable.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  6. #6
    Sencha User
    Join Date
    Apr 2013
    Posts
    142
    Answers
    5

    Default

    Code:
    Ext.define(null, {  
    
        override: 'Ext.grid.cell.Tree',
    
        privates: {
            syncIndent: function () {
                var me = this,
                    record = me.getRecord();
                if (!record || record.getTreeStore()) {
                    me.callParent(arguments);
                }
            }
        }
    });

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •