Listview 本地存储web sql数据的sencha touch 2中未填充列表视图

Listview 本地存储web sql数据的sencha touch 2中未填充列表视图,listview,sencha-touch-2,local-storage,store,Listview,Sencha Touch 2,Local Storage,Store,我有一个浏览器的web sql数据库。我只想在SenchaTouch2的视图类中显示该表的数据。但是数据没有显示,这里的视图是空的。我不知道为什么。这是代码,请帮助我,有人知道答案: Ext.define('FirstApp.view.UsersView',{ extend:'Ext.dataview.List', xtype:'userlist', requires:[ 'Ext.dataview.List', 'Ext.data.proxy.

我有一个浏览器的web sql数据库。我只想在SenchaTouch2的视图类中显示该表的数据。但是数据没有显示,这里的视图是空的。我不知道为什么。这是代码,请帮助我,有人知道答案:

Ext.define('FirstApp.view.UsersView',{
extend:'Ext.dataview.List',
xtype:'userlist',

requires:[
            'Ext.dataview.List',
            'Ext.data.proxy.LocalStorage',
            'Ext.data.identifier.Uuid'
        ],
config:{
    title:  'User List',
    iconCls:    'star',

    items:[
            {
                xtype:      'list',
                itemTpl:    '{name}',
                title:  'Students',

                store:{
                    autoLoad:   true,
                    fields: ["name","email"],

                    proxy:{
                            type: 'localstorage',
                            id: 'Student'
                        }
                    }
            }

    ]
    }

});
这里id是websql中数据库的名称。我不知道在这里到底写什么。

试试下面的代码

 Ext.define('FirstApp.view.UsersView',{
extend:'Ext.dataview.List',
xtype:'userlist',

requires:[
            'Ext.dataview.List',
            'Ext.data.proxy.LocalStorage',
            'Ext.data.identifier.Uuid'
        ],
config:{
    title:  'User List',
    iconCls:    'star',

    items:[
            {
                xtype:      'list',
                itemTpl:    '{name}',
                title:  'Students',

                store:new Ext.create('Ext.data.Store',{
                    autoLoad:   true,
                    fields: ["name","email"],

                    proxy:{
                            type: 'localstorage',
                            id: 'Student'
                        }
                    })
            }

    ]
    }

});

对于websql,您需要使用sql代理,而不是localstorage


您将在和中找到有关如何使用它的更多信息,感谢您的帖子。

感谢您的回复!那么你是说Web SQL和本地存储是分开的?在我的例子中,我有一个Web SQL类别的数据库。。。