Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtJS viewConfig plugin treeviewdragdrop throws error: Uncaught TypeError: Cannot read property 'init' of null

Here is my extended Ext.tree.Panel:

Ext.define('WP.view.portlet.Tree', {
    extend: 'Ext.tree.Panel',
    alias: 'widget.portlettree',


    store: 'Portlets',
    rootVisible: false,
    viewConfig: {
        plugins: {
            ptype: 'treeviewdragdrop'
        }
    }
});

When the page is loaded an error is thrown from the PluginManager.js file, line 58:

Uncaught TypeError: Cannot read property 'init' of null

The examples from Sencha use the same configuration, so I'm not sure what I'm missing that is causing this error. Thank you in advance.

like image 433
Brian Wendt Avatar asked Jun 03 '26 09:06

Brian Wendt


1 Answers

The correct way to fix this would be to require the plugin in your project.

In this case Ext.tree.plugin.TreeViewDragDrop.

For example:

Ext.application({

requires: [
    'Ext.chart.Chart',
    'Ext.chart.series.Line',
    'Ext.chart.series.Column',
    'Ext.chart.axis.Numeric',
    'Ext.chart.axis.Category',
    'Ext.layout.container.Border',
    'Ext.tree.plugin.TreeViewDragDrop'
], 
...
like image 87
Rocco Avatar answered Jun 06 '26 06:06

Rocco



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!