Migrating to v11 from v9 - custom cell blows up

Posted by: jkainth on 8 January 2018, 6:33 am EST

    • Post Options:
    • Link

    Posted 8 January 2018, 6:33 am EST

    Hey,

    We have a custom treenode cell that worked well in v9 until it just started to blow up upgrading to v11.

    Seems like the internal spreadjs code changed - where a property became a function.

    Not sure how to fix it…

    here is the code that blows up

    
    	TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
                var level = hitinfo.sheet.rowRangeGroup.getLevel(hitinfo.row);
                var hoffset = (level + 2) * this.iconSpace + hitinfo.cellRect.x;
                if (hitinfo.x < hoffset - 3 && hitinfo.x > hoffset - 21) {
                    var collapsed = hitinfo.sheet.rowRangeGroup.isCollapsed(hitinfo.row + 1);
                    hitinfo.sheet.rowRangeGroup.setCollapsed(hitinfo.row, !collapsed);
                    hitinfo.sheet.invalidateLayout();
                    hitinfo.sheet.repaint();
                }
            };
    
    

    the line with setCollapsed blows up with following error:

    self.direction is not a function. Line 81255
    
  • Posted 9 January 2018, 2:29 am EST

    Hello,

    Please have a look at the documentation given here for Custom cell type with latest version and make the changes accordingly:

    http://help.grapecity.com/spread/SpreadSheets11/webframe.html#SpreadJS~GC.Spread.Sheets.CellTypes.Base~processMouseDown.html

    Thanks,

    Deepak Sharma

  • Posted 9 January 2018, 3:30 am EST

    That does not remotely answer my question.

    Like stated the exception is thrown on the rowRangeGroup.setCollapsed line which has nothing to do with the processMouseDown to which you link points to.

    The exception happens in rangeGroup code, and apparently in the use of outline column types.

    Anyways for someone else reading this.

    SP11 has a new feature - “Outline column”, so instead to trying to fix my custom implementation of the treenode cell (above code) - we will just swap out to use the Outline column to do that same thing.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels