创建一个model,如:
Ext.define("VideoHelper.model.Tvplay",{
extend : 'Ext.data.Model',
config : {
fields : [
{ name : 'name', type : 'string'},
{ name : 'pic', type : 'string'},
{ name : 'score', type : 'int'},
{ name : 'brief', type : 'string'},
{ name : 'playurl', type : 'string'},
{ name : 'trailerUrl', type : 'string'},
{ name : 'releaseDate', type : 'string'},
{ name : 'displaystatus', type : 'string'},
],
}
});
创建一个store,如:
/**
* 市场活动
*/
Ext.define('VideoHelper.store.Tvplays', {
extend : 'Ext.data.Store',
config : {
model : 'VideoHelper.model.Tvplay',
}
});
添加数据:
var tvplayManager = Ext.StoreManager.get('Tvplays');
var item = [{
name : 'haha',
pic : 'http://g1.ykimg.com/050B000051B03E83675839362B0AE8F2',
score: 6.7,
brief: '玄武门之变后~',
playurl: 'http://www.iqiyi.com/v_19rrgyogws.html',
trailerUrl: 'http://v.youku.com/v_show/id_XNjYyOTAwMzAw.html',
releaseDate: '2014-00-00',
displaystatus : '更新至57集',
}];
tvplayManager.addData(item);
这样数据就加入到了store里。