sencha listview不可单击
我在sencha中有一个listview,它显示来自web sql数据库的记录。我正在app.js的启动功能中加载我的商店,以便我的listview可以显示记录。但是listview是不可点击的。无论如何,如果我没有像这样加载store,并且在通过视图在web sql中输入数据后,然后加载store,那么listview是可点击的。我没有看到任何人面临这个问题。我不知道为什么会发生这种情况。如果我在这里犯了任何错误,请帮助我:sencha listview不可单击,listview,sencha-touch-2,onclicklistener,Listview,Sencha Touch 2,Onclicklistener,我在sencha中有一个listview,它显示来自web sql数据库的记录。我正在app.js的启动功能中加载我的商店,以便我的listview可以显示记录。但是listview是不可点击的。无论如何,如果我没有像这样加载store,并且在通过视图在web sql中输入数据后,然后加载store,那么listview是可点击的。我没有看到任何人面临这个问题。我不知道为什么会发生这种情况。如果我在这里犯了任何错误,请帮助我: //launch function of app.js launch
//launch function of app.js
launch: function() {
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
if(Ext.getStore('Events') != null)
{
Ext.getStore('Events').load();
}
// Initialize the main view
Ext.Viewport.add(Ext.create('FirstApp.view.Main'));
}
//my store
Ext.define('FirstApp.store.Events',{
extend: 'Ext.data.Store',
config: {
model: 'FirstApp.model.Event',
storeId: 'Events'
}
});
//view class of listview
Ext.define('FirstApp.view.Events',{
extend: 'Ext.List',
xtype: 'eventList',
id: 'eventList',
requires:[ 'Ext.data.Store','FirstApp.store.Events'],
config: {
title: 'Events',
iconCls: 'organize',
store: 'Events',
itemTpl: '{name}',
onItemDisclosure: true
},
initialize:function(){
/*if(Ext.getStore('Events') != null)
{
Ext.getStore('Events').load();
}*/
}
});
//my model class
Ext.define("FirstApp.model.Event", {
extend: "Ext.data.Model",
config: {
fields: [
{name: "event_Id", type: "INTEGER"},
"name",
"description",
{name: "pic_url", type: "text", defaultValue: ""},
{name: "modified_Date", type: "date", defaultValue: new Date()},
{name: "created_Date", type: "date", defaultValue: new Date()},
],
proxy: {
type: "sql"
}
}
});
这是你的全部密码吗?对于我所能看到的,我可以说,考虑一下: -您将在视图初始化和内部启动功能中加载两次存储 -您可以使用
自动加载:true
内部存储配置进行自动加载
-我在你的商店中没有看到任何已定义的代理,也没有内联数据,请查看:谢谢你的回复,这是我的错,我只是在app.js的启动功能中加载我的商店。视图的初始化函数被注释了。我已经更新了上面的代码。但它的nt在两种情况下都运行。代理是在模型类中定义的,所以我认为不需要在存储中定义