-
3 Sep 2011 6:52 PM #1
renderTpl on ComboBox causes crash
renderTpl on ComboBox causes crash
renderTpl on ComboBox causes fatal error
Designer version tested:- Designer 1.2.0
- Win7
- Ext JS 4.0.5
- Attempting to use renderTpl attribute and program fatally fails
- Causes rendering in design to fail and I have to restart designer entirely
'<tpl for="."><div class="x-combo-list-item">',
'{firstname} {lastname} ({email})',
'</div></tpl>'
- in code view it produces quoted code if using an object of strings.
- me.renderTpl = Ext.create('Ext.XTemplate',
'{\'<tpl for="."><div class="x-combo-list-item">\',',
'\'{firstname} {lastname} ({email})\',',
'\'</div></tpl>\'}'
);
- me.renderTpl = Ext.create('Ext.XTemplate',
- if using a string I get "TypeError: 'null' is not an object
- <tpl for="."><div class="x-combo-list-item">{firstname} {lastname} ({email})</div></tpl>
- Or messed up rendering and have to restart...
- <div class="x-combo-list-item">{firstname} {lastname} ({email})</div>
- I would expect the system to throw an error message and null out the renderTpl if it fails.
- In Design Mode: fatally crashing the program either by error or bad rendering
- Code Mode: just renders code as it would, no errors, but going to Design will cause the error if renderTpl is left that way.
can anyone tell me how to get ComboBox to render multiple fields to displayField in Designer?
no convert option for datastore field in designer. (that would be awesome)
-
6 Sep 2011 9:52 AM #2
Thanks for the bug report. We've opened a ticket to fix this.
Aaron Conran
@aconran
Sencha Architect Development Team
-
19 Sep 2011 12:16 PM #3Sencha - Desktop Packager Dev Team
- Join Date
- Mar 2007
- Location
- Baltimore, MD.
- Posts
- 1,745
- Vote Rating
- 5
This is a non-issue. In 4.x, the BoundList is the DataView provider for the ComboBox field. Drag out a BoundList from the toolbox onto the ComboBox, which will provide the "listConfig" code generation on the ComboBox. You can then set the "tpl" config option on the BoundList to override the default tpl used by the ComboBox.
See the docs for Ext.view.BoundList to know what item selectors to expect by default, etc.
-
21 Sep 2011 8:39 AM #4
For others looking at Templated ComboBox using Designer
For others looking at Templated ComboBox using Designer
i set the tpl to this...
Looks like it needs to be the unordered list with list items, role=option, and class = x-boundlist-item for the default functionality to work.Code:<ul><tpl for="."><li role="option" class="x-boundlist-item">{FirstName} {LastName} ({Reporting})</li></tpl></ul>
itemSelector says required in docs, but not required in Designer! not sure what problems this may cause, but it is working for me.
Looks like we can't reproduce the issue or there's a problem in the test case provided.



Reply With Quote