comparison _test/Resources/TTView/My/Org/Panel.tt @ 190:cd1ff7029a63

IMLP::Web::View refactored, added new method 'require' which is available inside templates. Changed document rendering.
author cin
date Wed, 04 Apr 2012 17:51:27 +0400
parents 08015e2803f1
children 78a18a2b6266
comparison
equal deleted inserted replaced
189:08015e2803f1 190:cd1ff7029a63
1 [% 1 [%
2 META version = 1; 2 META version = 1;
3 BLOCK INIT; 3 BLOCK INIT;
4 dojoDefaultClass = 'dijit.form.Input'; 4 dojoDefaultClass = 'dijit.form.Input';
5 dojo.require.push( dojoDefaultClass ); 5 dojo.require.push( dojoDefaultClass );
6 TPreview = require('My/Org/TextPreview');
6 END; 7 END;
7 BLOCK CTOR; 8 BLOCK CTOR;
8 dojoClass = dojoDefaultClass; 9 dojoClass = dojoDefaultClass;
9 visualClass = this.nodeProperty('visualClass') || 'classic'; 10 visualClass = this.visualClass || 'classic';
11 FOREACH text IN data;
12 CALL this.appendChild(TPreview.new('preview', nodeValue = text ));
13 END;
10 END; 14 END;
11 %] 15 %]
12 [% BLOCK RENDER %] 16 [% BLOCK RENDER %]
13 [%
14 TPreview = document.require('My/Org/TextPreview');
15 FOREACH text IN data;
16 CALL this.appendChild(TPreview.new('preview', nodeValue = text ));
17 END;
18 %]
19 <div class="$visualClass" data-dojo-type="$dojoClass"> 17 <div class="$visualClass" data-dojo-type="$dojoClass">
20 [% FOREACH node IN this.selectNodes('preview') %] 18 [% FOREACH node IN this.selectNodes('preview') %]
21 [% node.Render() %] 19 [% node.Render() %]
22 <hr /> 20 <hr />
23 [% END %] 21 [% END %]