extjs - How to set (title of) detail view with Ext navigation view -
what's proper way of setting (title of) detail view ext navigation view?
1st approach
in sencha list tutorial (video) controller does
this.getmain().push({ xtype: 'presidentdetail', title: record.fullname(), data: record.getdata() });
and detail view regular ext.panel
tpl.
2nd approach
however, navigation view example ships sencha touch download (code here) takes totally different approach. here controller does
this.showcontact = ext.create('addressbook.view.contact.show'); this.showcontact.setrecord(record); this.getmain().push(this.showcontact);
and detail view contains quite bit of code don't understand (yet)
ext.define('addressbook.view.contact.show', { extend: 'ext.container', ... config: { title: 'information', basecls: 'x-show-contact', layout: 'vbox', items: [ { id: 'content', tpl: ... }, ... }, updaterecord: function (newrecord) { if (newrecord) { this.down('#content').setdata(newrecord.data); .. } } });
confusion
for sencha/ext rookie me confusing. advantages 1 approach have on other? how different in achieve?
the first approach updates title of detail view (which title in navigation bar) in controller. have not yet found out how same using second approach. hints?
Comments
Post a Comment