emm
24 Sep 2010, 7:22 AM
Hi,
I use localstorage to save data from a twitter account. I use this model to read a twitter timeline :
Ext.regModel('tweetMod', {
fields: [
{name:'idid', type:'string', mapping: 'id'}, //id
{name:'text', type:'auto'}, //message
{name:'created_at', type: 'date'},
{name:'user', type:'auto'}
]
});
and then this model to save the data in localstorage
Ext.regModel('tweetModFav', {
fields: [
{name:'idid', type:'string'}, //id
{name:'text', type:'auto'}, //message
{name:'created_at', type: 'date',
encode: function(value) {
return +(value);
},
decode: function(value) {
return new Date(value);
},
},
{name:'user', type:'auto'}
]
});
Now I want to add data to each record : to do that I can add a {name:'newdata', type:'string'} to the model for localstorage.
But then, how can I add data to each record of the store I use for reading twitter stream?
Thanks for your help!
Best,
emm
I use localstorage to save data from a twitter account. I use this model to read a twitter timeline :
Ext.regModel('tweetMod', {
fields: [
{name:'idid', type:'string', mapping: 'id'}, //id
{name:'text', type:'auto'}, //message
{name:'created_at', type: 'date'},
{name:'user', type:'auto'}
]
});
and then this model to save the data in localstorage
Ext.regModel('tweetModFav', {
fields: [
{name:'idid', type:'string'}, //id
{name:'text', type:'auto'}, //message
{name:'created_at', type: 'date',
encode: function(value) {
return +(value);
},
decode: function(value) {
return new Date(value);
},
},
{name:'user', type:'auto'}
]
});
Now I want to add data to each record : to do that I can add a {name:'newdata', type:'string'} to the model for localstorage.
But then, how can I add data to each record of the store I use for reading twitter stream?
Thanks for your help!
Best,
emm