//In view i have created one list with item tpl. below is the code
{
xtype:'list',
id:'userReviewList',
title:'User Review',
store:'UserReviewStore',
height:300,
itemTpl:'<div >{Comment}</div>' + '<div >{Rating}</div>' + '<div >{ReviewId}</div>'
}
//以下では、データ セクションにハード コードされた値を使用してモデルを作成しています。
Ext.define('AppName.store.UserReviewStore',{
extend:'Ext.data.Store',
id:'reviewStore',
config:{
fileds:[
{name:'Comment',type:'string'},
{name:'Rating', type:'int'},
{name:'ReviewId',tyep:'int'}
]
},
data: [
{ Comment: 'nice', Rating: 5, ReviewId: 1 },
{ Comment: 'cool', Rating: 4, ReviewId: 2 },
{ Comment: 'awesome', Rating: 3, ReviewId: 3 }
]
})
// リスト ビューでデータを表示することはできますが、リストに表示するにはローカル ストレージ データを使用する必要があります。ベローは、アプリの起動時に同僚が保存するローカルストレージデータを取得するコードであるため、ローカルストレージからデータを取得し、ストアにバインドする必要があります
var retrievedObject = localStorage.getItem('testObject');//getting local storage
var jsonObj = Ext.decode(retrievedObject);//decoding
このデコードの後、次のような値のリストを1つ取得します
var list = jsonObj.userReviewList
このリストをバインドして、その方法を保存する必要があります。ストアにバインドするロジックをどこに書くべきか