문제

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