日期:2014-05-16  浏览次数:20438 次

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>',