I have a web sql database of browser. I just want to show the data of that table in my view class in sencha touch 2. But data is not being shown the view is empty here.I don't know why.Here is the code kindly help me out of someone knows the answer:

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

    ]
    }

});

here id is the name of the database in websql. I don't know what to write here exactly.

有帮助吗?

解决方案

For websql, you'll need to use the sql proxy, not localstorage.

You'll find more info on how to use it in the doc and in this blog post, thanks to this post.

其他提示

try below code

 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'
                        }
                    })
            }

    ]
    }

});
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top