I have a dataview, I get a copy of the:
I want to use the new template in dataview:
then I get store:
check the output in the console:
it's OK.
get data from dataview for new Template
Code:
var panelLand = Ext.getCmp('dataview');
I want to use the new template in dataview:
Code:
panelLand.tpl =new Ext .XTemplate (
'<tpl for=".">', '<div class="x-dataview-item" role="option" tabindex="-1">', '<table class="tabview">', ' <tr name=\'land\'>', ' <td width=\'200px\'><input type="checkbox" enabled="enabled" value="open" name="comment_status" <tpl if="active">checked="checked"</tpl> />{area}{name}{perimeter}</td>', ' <td class="configure"></td>', ' </tr> ', ' </table>', '</tpl>', ' ' );
then I get store:
Code:
var storeLand=Ext.StoreManager.get('Land');
check the output in the console:
Code:
console.log(storeLand.getAt(0 ).get ('name' ));
Code:
console.log(storeLand.getAt(0).get('area'));
console.log(storeLand.getAt(0 ).get ('perimeter' ));
it's OK.
please tell me what I should do more to display the data in my template?
my store:
Code:
Ext.define('MyApp.store.Land', { extend: 'Ext.data.Store',
model: 'MyApp.model.Land',
proxy: {
type: 'ajax',
url: 'http://localhost:3000/wialoncollector/geozone/'+MyApp.username+'/'+Ext.util.Cookies.get("ssid"),
callbackKey: 'callback',
reader: {
root: 'items[0].zl'
}
}
});
get data from dataview for new Template
Aucun commentaire:
Enregistrer un commentaire