Hybrid View
-
20 Apr 2012 7:56 AM #1
xtemplate?
xtemplate?
Hello,
Does Architect 2 have an XTemplate object? I don't see it in the Toolbars list of objects. I could hand-code my template, but, I don't know were in Architect to employ this code.
Thanks,
-dwb
-
20 Apr 2012 11:44 AM #2
XTemplate is available as a property(config) for many components eg tpl for component and itemTpl for Dataview.
Bharat Nagwani
Sencha Designer Development Team
-
24 May 2012 1:40 AM #3
If it is available, so what do I do wrong whereas I am trying to put XTemplate for itemTpl in Dataview?
Thanks in advance!Code:Ext.define('mBooking.view.ReservationFormContainer', { extend: 'Ext.Container', alias: 'widget.reservationformcontainer', config: { layout: { type: 'card' }, items: [ { xtype: 'list', id: 'dates-from', itemTpl: [ 'new Ext.XTemplate(', ' \'<div class="availability-date-item \',', ' \'{[AvailabilityStatus.getName(values.Status)]} {[PeriodType.getName(values.PeriodType)]}\',', ' \'<tpl if="this.IsConference(PeriodType)">\',', ' \' Conference\',', ' \'</tpl>\',', ' \'<tpl if="this.IsExternalEvent(PeriodType)">\',', ' \' ExternalEvent\',', ' \'</tpl>\',', ' \'">\',', ' \'<div class="container">\',', ' \'<div class="date" style="width: 20%;">{[getDay(values.Date)]}</div>\',', ' \'<div style="width: 75%;">\',', ' \'<div><span class="description">{[PeriodType.getDescription(values.PeriodType)]}</span></div>\',', ' \'<div class="status">{[AvailabilityStatus.getDescription(values.Status)]}</div>\',', ' \'</div>\',', ' \'</div>\',', ' \'</div>\',', ' {', ' disableFormats: true,', ' IsConference: function(periodType) {', ' return PeriodType.isConference(periodType);', ' },', ' IsExternalEvent: function(periodType) {', ' return PeriodType.isExternalEvent(periodType);', ' }', ' }', ' )' ], store: 'AvailabilityCalendar', onItemDisclosure: true }, { xtype: 'container', id: 'dates-to', layout: { type: 'fit' } } ] } });
-
24 May 2012 11:31 AM #4
hi,
For example, select some container and then in config panel you have tpl box. In tpl box you can insert something like this:
Note that tpl accepts string(?) so you cannot write something like this:Code:<div>something</div>
Code:new Ext.XTemplate('<div>something</div>')
-
24 May 2012 12:36 PM #5
-
13 Jun 2012 8:23 AM #6
I would also like to know how this can be accomplished.
There does not seem to be any way to define a new Ext.XTemplate in the tpl in Architect 2 since the config tpl interprets everything as a string.
-
14 Jun 2012 2:58 AM #7
I've tried to change it in notepad and it did worked however when I open Archtect the value changes again. It seems at we can't edit any sencha files with external editors. It is quite inconvenient!
Any response from Sencha, please?
It explains a lot:
* This file will be auto-generated each and everytime you save your project. *
* Do NOT hand edit this file.
-
14 Jun 2012 3:27 PM #8
sencha generates files and you cannot change them, you can only make overrides.
Generally, it doesnt matter what you do with generated files bcs they are regenerated(from metadata files) each time you save project.


Reply With Quote