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

ExtJs Grid问题!
这我的项目的结构
Model:
Ext.define("user",{
        extend : 'Ext.data.Model',
    fields : [
        {name: 'name', type: 'string'},
        {name: 'email', type: 'string'},
        {name: 'phone', type: 'string'}
    ]
});

store:
Ext.create("Ext.data.Store",{
        model : "user",
        storeId : "usersStore",
        /*data: [
        { name: 'Lisa', email: 'lisa@simpsons.com', phone: '555-111-1224' },
        { name: 'Bart', email: 'bart@simpsons.com', phone: '555-222-1234' },
        { name: 'Homer', email: 'home@simpsons.com', phone: '555-222-1244' },
        { name: 'Marge', email: 'marge@simpsons.com', phone: '555-222-1254' }
    ]*/
        proxy : {
                type: 'ajax',
        url : './TestData.jsp',
        reader: {
            type: 'json',
            root: 'users'
        },
        writer : {
                type:"json"
        }
        },
        
        autoLoad : true
});


Grid:
function(){
        Ext.onReady(function(){
                var s = Ext.data.StoreManager.lookup("usersStore");
                window.alert(s.getCount());
                
                Ext.tip.QuickTipManager.init();
                
                Ext.create('Ext.grid.Panel', {
                    renderTo: Ext.getBody(),
                    store: Ext.data.StoreManager.l