-
27 May 2012 8:19 AM #11
how do I do that without this?:
I tried some ways, but Google doesnt help much. I found something with this code in the Controller:Code:this.fireEvent
but it all fails or I get Errors..Code:this.getApplication().on({ 'disclosetest' : function(list, record, target, index, evt, options) { ... }, scope : this });
-
31 May 2012 2:04 AM #12
Okay, after a lot of searching I found this link:
http://www.sencha.com/forum/showthre...ItemDisclosure
This is what I changed in the Controller:
and later:Code:control : { "#myList" : { disclose : "onDetailCommand" } },
In my listContainerList-FileCode:onDetailCommand : function(list, record, target, index, evt, options) { console.log("onDetailCommand"); //.. },
But I still see no Data in the following View! So Problem is still there..Code:var allList = { xtype : 'mylist', itemId : 'myList', id : 'myList', store : store };
In the View I want to show the Data as follows:
and the xtype platedetail looks as follows:Code:var content = { xtype : 'platedetail', };
How do I set the Data with the record? I set the Record like before:Code:Ext.define("Autokennzeichen.view.PlateDetail", { extend : "Ext.Component", alias : "widget.platedetail", config : { data : {}, tpl : Ext.create('Ext.XTemplate', '<div><b>City</b> {City}</div>') } });
Code:var detail = this.getPlateDetail(); detail.setRecord(record); list.select(index, true, false); Ext.Viewport.animateActiveItem(detail, { type : 'slide', direction : 'left'});
-
3 Jun 2012 1:18 PM #13
Try something like this:
orCode:var record = Ext.create(Myapp.model.MyModel, { City: 'Hamburg', .... }) Ext.widget({ xtype : 'component', fullscreen: true, record : record, tpl : Ext.create('Ext.XTemplate', '<div><b>City</b> {City}</div>') });
Code:Ext.widget({ xtype : 'component', fullscreen: true, data : record.getData(), tpl : Ext.create('Ext.XTemplate', '<div><b>City</b> {City}</div>') });
-
6 Jun 2012 12:44 AM #14
I think I finally understood my Problem. I already tried a lot, working with record and this.record BUT the Problem (I think) is, that my whole Views render while starting my App. And at this Moment the record is still empty.
The workaround I did now, pretty dirty - but I didnt knew how to reload a page or Element. So I set the record values of my Field in the Controller.
And my 'contentPanel' looks like thisCode:var detail = this.getPlateDetail(); detail.setRecord(record); var discloseWorkaround = detail.down('#contentPanel'); discloseWorkaround.setData({ data1 : record.get('City') }); list.select(index, true, false);
Is there a better way, to refresh a View? Or maybe just one Element. That I can set in the 'content' Element at data:Code:var content = { xtype : 'panel', itemId : 'contentPanel', id : 'contentPanel', cls : 'detailContainerContainer', data : { data1 : '' }, tpl : Ext.create('Ext.XTemplate', '<div class="detailContainer">City <b> {data1}</b></div>') };
Or something equal?Code:data : { data1 : record.get('City') }


Reply With Quote