简体   繁体   English

Extjs查看渲染问题,Uncaught TypeError:无法读取未定义的属性'tooNarrow'

[英]Extjs view rendering issue,Uncaught TypeError: Cannot read property 'tooNarrow' of undefined

Hello I have thr following view and they worked well with Extjs 4.1 library but know I use 5.1 version and when I am trying use it, it is not rendering pproperly on doLayout() and show Uncaught TypeError: Cannot read property 'tooNarrow' of undefined. 您好我有以下视图,他们与Extjs 4.1库工作得很好,但知道我使用5.1版本,当我尝试使用它时,它不会在doLayout()上显示pproperly并显示Uncaught TypeError:无法读取属性'tooNarrow'的undefined 。 I am newbie in Extjs maybe in 5.1 library has different options that I dont know?Please help 我是Extjs的新手也许在5.1库中有不同的选项,我不知道?请帮忙
Fist I am trying to load PersonPanelView: 拳头我正在尝试加载PersonPanelView:

PersonPanelView: PersonPanelView:

Ext.define('Pandora.view.Person.PersonPanelView', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.PersonPanel',
    layout: 'hbox',

    items:[
        {
            flex:1.8,
            xtype:'PersonList',
            height:'100%',
            title:'List of persons'
        },
        {
            flex:3,
            height:'100%',
            xtype:'panel',
            id:'personProfileId',
            autoScroll:true,
            title:'Person profile',
            //frame:true,
            bodyStyle:{background: '#99bce8'}
        }

    ]
});

PersonList: PersonList:

Ext.define('Pandora.view.Person.PersonListView', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.PersonList',
    layout: 'border',
    title: 'Person',
    store: 'Person.PersonStore',
    autoScroll:true,
    dockedItems:[
        {
            tbar:[
                { xtype:'button', text:'Add Person',name:'addPerson'        },'-',
                { xtype:'button', text:'Edit Person',name:'editPerson'      },'-',
                { xtype:'button', text:'Remove Person',name:'removePerson'  },'-',
                { xtype:'button', text:'Add Conference',name:'addConference'},'-',
                { xtype:'button', text:'Add Event',name:'addEvent'}
            ]
        }
    ],
    columns: [
        { text: 'Login',  dataIndex: 'login' , flex:1,align:'center'},//
        { text: 'Name', dataIndex: 'name', flex:1,align:'center'},
        { text: 'Surname', dataIndex: 'surname', flex:1,align:'center'},
    ]
});

PersonStore: PersonStore:

Ext.define('Pandora.store.Person.PersonStore', {
    extend: 'Ext.data.Store',
    model: 'Pandora.model.Person.PersonModel',
    autoLoad:true,
    proxy: {
        type: 'ajax',
        url: 'do/person/getAllPersons'
    }
});

PersonModel: PersonModel:

Ext.define('Pandora.model.Person.PersonModel', {
    extend: 'Ext.data.Model',
    fields: [
        'id',
        'login',
        'password',
        'email',
        'name',
        'avatar',
        'surname',
        'relationship',
        'phoneNumber',
        'gender',
        'country',
        'city',
        'school',
        'university',
        'persons',        
        'conferences',        
        'images',        
        'requests',        
        'followers',        
        {name:'posts',type:'auto'},
        'dateOfBirth'
    ]
});

A few things you should do here: 你应该在这里做一些事情:

1 - Unless you really know what you are doing, you should not be changing the grid layout. 1 - 除非你真的知道自己在做什么,否则你不应该改变网格布局。 Remove the line where you set layout: 'border' and the error will go away. 删除设置layout: 'border'的行layout: 'border' ,错误将消失。

2 - The tbar does not go inside the dockedItems config. 2 - tbar不会进入dockedItems配置。

3 - The autoScroll config is called scrollable now, and it is set to true by default. 3 - autoScroll配置现在称为可滚动,默认情况下设置为true。

This is what your Grid should look like: 这就是你的网格应该是这样的:

Ext.define('Pandora.view.Person.PersonListView', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.PersonList',
    title: 'Person',
    store: Ext.create('Pandora.store.Person.PersonStore'),

    tbar:[
        { xtype:'button', text:'Add Person',name:'addPerson'        },'-',
        { xtype:'button', text:'Edit Person',name:'editPerson'      },'-',
        { xtype:'button', text:'Remove Person',name:'removePerson'  },'-',
        { xtype:'button', text:'Add Conference',name:'addConference'},'-',
        { xtype:'button', text:'Add Event',name:'addEvent'}
    ],
    columns: [{ 
        text: 'Login',  dataIndex: 'login' , flex:1,align:'center'
    },{ 
        text: 'Name', dataIndex: 'name', flex:1,align:'center'
    },{ 
        text: 'Surname', dataIndex: 'surname', flex:1,align:'center'
    }]
});

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Extjs5 treepanel [未捕获的TypeError:无法读取未定义的属性'create'] - Extjs5 treepanel [Uncaught TypeError: Cannot read property 'create' of undefined] ExtJS:未捕获的TypeError:无法读取未定义的属性“作用域” - ExtJS: Uncaught TypeError: Cannot read property 'scope' of undefined “未捕获的TypeError:无法读取未定义的属性'createDocumentFragment'”问题 - “Uncaught TypeError: Cannot read property 'createDocumentFragment' of undefined” issue Javascript 问题 - 未捕获的类型错误:无法读取未定义的属性“incart” - Javascript issue- Uncaught TypeError: Cannot read property 'incart' of undefined Javascript问题-未捕获的TypeError:无法读取未定义的属性'x' - Javascript Issue - Uncaught TypeError: Cannot read property 'x' of undefined 未捕获的TypeError:无法读取未定义的属性“未定义” - Uncaught TypeError: Cannot read property 'undefined' of undefined 未捕获的TypeError:无法读取未定义的属性“数量” - Uncaught TypeError: Cannot read property 'quantity' of undefined 未捕获的TypeError:无法读取未定义的属性'fromJSON' - Uncaught TypeError: Cannot read property 'fromJSON' of undefined 未捕获的TypeError:无法读取未定义的属性“ timing” - Uncaught TypeError: Cannot read property 'timing' of undefined 未捕获的TypeError:无法读取未定义的属性'formatter' - Uncaught TypeError: Cannot read property 'formatter' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM