Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Extjs 如何回溯调试ext-all-debug.js返回的错误_Extjs - Fatal编程技术网

Extjs 如何回溯调试ext-all-debug.js返回的错误

Extjs 如何回溯调试ext-all-debug.js返回的错误,extjs,Extjs,你可以在我添加代码的地方看到我的注释,然后错误就发生了,但是,我想学习如何回溯错误的来源,不幸的是,ext all debug.js只显示那些简单的错误注释,如何跟踪错误的来源?你可以做一些事情 请参考ext-dev.js。差异与两个文件之间的差异有关。ext-debug.js文件包含一次上载的所有支持javascript。ext-dev.js文件只包含核心文件,需要根据需要加载支持文件。这样我们可以得到更多的信息错误。在这种情况下,无法识别别名 第二,使用Chrome工具,右键单击并选择Ins


你可以在我添加代码的地方看到我的注释,然后错误就发生了,但是,我想学习如何回溯错误的来源,不幸的是,
ext all debug.js
只显示那些简单的错误注释,如何跟踪错误的来源?

你可以做一些事情

请参考ext-dev.js。差异与两个文件之间的差异有关。ext-debug.js文件包含一次上载的所有支持javascript。ext-dev.js文件只包含核心文件,需要根据需要加载支持文件。这样我们可以得到更多的信息错误。在这种情况下,无法识别别名

第二,使用Chrome工具,右键单击并选择Inspect Element。通过单击开发人员工具区域右上角的暂停按钮两次,可以在sources选项卡中看到代码失败的实际行。它会变成紫色。下面的屏幕显示了我们现在如何看到突出显示的失败代码行

Ext.Loader.setConfig({enabled: true});
Ext.Loader.setPath('Ext.ux', '/ux');
Ext.require([
    'Ext.tip.QuickTipManager',
    'Ext.menu.*',
    'Ext.form.field.ComboBox',
    'Ext.layout.container.Table',
    'Ext.container.ButtonGroup',
    'Ext.form.FieldSet',
    'Ext.data.*',
    'Ext.form.*'
]);
Ext.onReady(function() {
    Ext.QuickTips.init(); //tips box


Ext.define('MyApp.view.MyContainer13', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.myroutegridpanel',

    width:  window.innerWidth,
    header: false,
    height: window.innerHeight,
    //renderTo: Ext.getBody(), //cannot put in everywhere, if not this panel will full screen, can't see other already
    layout: {
        align: 'stretch',
        type: 'hbox'
    },

            items: [
                {
                    xtype: 'container',
                    flex: 1,
                    //maxWidth: window.innerWidth/3,
                    items: [
                        {
                             //xtype: 'mygridpanelroutename'
                            xtype: 'myroutegridpanel1'

                        }
                    ]
                }
            ]


});

// THIS IS THE PART I ADD IN, THEN ERROR OCCUR, until below ,please check my remark

Ext.create('Ext.window.Window', {
    alias: 'widget.myroutegridpanel1',
    width: 400,
    height: 400,
    title: 'Example of Dynamic Grid',
    layout: 'fit',
    items: [
        {
            // All what you have to set! :)
            xtype: 'dynamicGrid',
            url: 'route/get-routefare.php'
        }
    ]
});

Ext.define('Ext.ux.grid.DynamicGrid', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.dynamicGrid',
    alternateClassName: 'Ext.grid.DynamicGrid',
    // URL used for request to the server. Required
    url: '',

    initComponent: function() {
        var me = this;

        if (me.url == '') {
            Ext.Error.raise('url parameter is empty! You have to set proper url to get data form server.');
        }
        else {
            Ext.applyIf(me, {
                columns: [],
                forceFit: true,
                store: Ext.create('Ext.data.Store', {
                    // Fields have to be set as empty array. Without this Ext will not create dynamic model.
                    fields: [],
                    // After loading data grid have to reconfigure columns with dynamic created columns
                    // in Ext.ux.data.reader.DynamicReader
                    listeners: {
                        'metachange': function(store, meta) {
                            me.reconfigure(store, meta.columns);
                        }
                    },
                    autoLoad: true,
                    remoteSort: false,
                    remoteFilter: false,
                    remoteGroup: false,
                    proxy: {
                        reader: 'dynamicReader',
                        type: 'rest',
                        url: me.url
                    }
                })
            });
        }

        me.callParent(arguments);
    }
});

Ext.apply(Ext.data.Types, {
    FLOATORSTRING: {
        convert: function(v, n) {
            v = Ext.isNumeric(v) ? Number(v) : v;
            return v;
        },
        sortType: function(v) {
            v = Ext.isNumeric(v) ? Number(v) : v;
            return v;
        },
        type: 'floatOrString'
    }
});

Ext.define('Ext.ux.data.reader.DynamicReader', {
    extend: 'Ext.data.reader.Json',
    alias: 'reader.dynamicReader',
    alternateClassName: 'Ext.data.reader.DynamicReader',

    readRecords: function(data) {
        if (data.length > 0) {
            var item = data[0];
            var fields = new Array();
            var columns = new Array();
            var p;

            for (p in item) {
                if (p && p != undefined) {
                    // floatOrString type is only an option
                    // You can make your own data type for more complex situations
                    // or set it just to 'string'
                    fields.push({name: p, type: 'floatOrString'});
                    columns.push({text: p, dataIndex: p});
                }
            }


            data.metaData = { fields: fields, columns: columns };
        }

        return this.callParent([data]);
    }
});
 // UNTIL HERE, THOSE CODE AFTER ADDED, then returned ERROR in the picture below

}); // on ready