Hybrid View
-
27 Nov 2012 12:59 PM #1
Answered: List/Formpanel (Master/Detail ) after production build the form is empty
Answered: List/Formpanel (Master/Detail ) after production build the form is empty
Hello,
i coded a master-detail-view. The master is a list. By itemTap the form is created and should show the current record of the list. All works fine for me, but after "sencha app build production" the form is empty.
To reproduce i coded a (very) small example of the behavior. I started with generating a new clean project.
Than i implemented a short list.
MyForm.js:Code:Ext.define('Test.view.MyList', { extend: 'Ext.dataview.List', xtype: 'MyList', requires: [ 'Ext.data.Store' ], config: { fullscreen: true, itemTpl: '{title} {text}', data: [ { title: 'Item 1', text: 'text 1' }, { title: 'Item 2', text: 'text 2' } ], listeners: { itemtap: function( list, index, target, record, e, eOpts ) { var form = { xtype: 'MyForm', initialize: function () { this.callParent(arguments); // in real app i want to format the output, thats why i am using setValue() Ext.Array.each(this.getItems().items, function(item) { var name = item.getName(); var value = record.get(name); item.setValue(value); }); } }; Ext.Viewport.setActiveItem(form); } } } });
the result is (first the list, second after itemTap):Code:Ext.define('Test.view.MyForm', { extend: 'Ext.form.Panel', xtype: 'MyForm', requires: [ 'Ext.field.Text' ], config: { fullscreen: true, defaults: { xtype: 'textfield' }, items: [ { name: 'title', label: 'Title' }, { name: 'text', label: 'Text' } ] } });
before.png
after running the "sencha app build production"-command the result is:
after.png
Whats wrong? why form is empty? (Testing has the same result, empty form, no error, no warning)
Sencha Touch 2.1.0
Sencha Cmd 3.0.0.250
-
Best Answer Posted by mitchellsimoens
In production, you cannot override methods (initialize) like that.
-
29 Nov 2012 7:28 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
In production, you cannot override methods (initialize) like that.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
1 Dec 2012 4:40 AM #3
mh okay. i am now using still the record config of the list. sencha is doing the "magic". what is the easiest way to transform the output? e.g. record contains some date fields. In detailview i want only show day, time or whatever. is there something like a renderer? For now, i just transform the data on serverside and add fields to store/model.


Reply With Quote