欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

ext.view.view使用tpl有关问题

更新时间: 2014-01-05 01:51:05 责任编辑: Author_N1

 

Ext.view.View使用TPL问题
代码如下:
 {
            /// <reference path="../../ext/ext-all.js" />
            Ext.define('User', {
                extend: 'Ext.data.Model',
                fields: ["name", "title"],
                hasMany: [{ model: 'User', name: 'childrens' }]
            });

            var myStore = Ext.create('Ext.data.Store', {
                model: 'User',
                proxy: {
                    type: 'ajax',
                    url: 'user.txt',
                    reader: {
                        type: 'json',
                        root: 'users'
                    }
                },
                autoLoad: true
            });

            Ext.create('Ext.view.View', {
                width:200,
                store: myStore,
                tpl: ['<div>',
                    '<tpl for=".">',
                    '<div>',
                            '<div class="nrm_menu_banner">{name}</div>',
                            '<tpl for="childrens">',
                            '<div class="nrm_menu_content">{name}</div>',
                            '</tpl>',
                            '</div>',
                    '</tpl>',
                    '</div>'
                ],
                itemSelector: 'div.nrm_menu_content',
                overItemCls: 'hover',
                trackOver: true,
                renderTo: Ext.getBody()
            });
        }
现在遇到的问题是,如果itemSelector设置为 'div.nrm_menu_content',则报
Uncaught TypeError: Cannot read property 'internalId' of undefined错误,why???