와 센차 터치에서 WebSQL을 사용할 수 있습니다 어떻게 이런 일이 내 모델 :내가 고유 한 ID
Ext.define('myApp.model.Category', {
extend: 'Ext.data.Model',
requires: [
'Ext.data.Field'
],
config: {
fields: [
{
name: 'id',
type: 'int'
},
{
name: 'slug',
type:'string'
},
{
name: 'title',
type:'string'
},
{
name: 'post_count',
type:'int'
}
],
}});
이 내 가게 :
지금Ext.define('myApp.store.LocalCate',{
extend: 'Ext.data.Store',
requires: [
'Ext.data.proxy.Sql'
],
config: {
autoLoad:false,
model:'myApp.model.Category',
storeId:'LocalCate',
proxy:{
type: 'sql',
database: 'myApp',
table: 'Category'
},
}
});
문제가되는 : 내가 store.add({id:123,slug:'123',title:'123',post_count:123});
를 사용 또는 store.add(Ext.create('myApp.model.Category'{id:123,slug:'123',title:'123',post_count:123});
둘 다 작동하지 않습니다. '123 ID'만 그것을 밖으로 작동하고 내가 store.sync()
을 할 때 WebSql 데이터베이스 '아이디'없이 데이터를 표시 데이터
{slug:'123',title:'123',post_count:123}
를 추가 내가를 삭제할 때 나타납니다. id를 'cate_id'와 같은 다른 것으로 변경하면 작동한다는 것을 알고 있습니다. 그러나 idproperty로이 'id'를 원하며 그 이름을 변경하고 싶지 않습니다. 어떻게해야합니까? sencha touch에서 websql을 어떻게 사용합니까? LocalStorage에서도 같은 문제가 발생합니다.