Mercurial > pub > Impl
diff _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 |
line wrap: on
line diff
--- a/_test/Resources/TTView/My/Org/Panel.tt Wed Apr 04 02:49:45 2012 +0400 +++ b/_test/Resources/TTView/My/Org/Panel.tt Wed Apr 04 17:51:27 2012 +0400 @@ -3,19 +3,17 @@ BLOCK INIT; dojoDefaultClass = 'dijit.form.Input'; dojo.require.push( dojoDefaultClass ); + TPreview = require('My/Org/TextPreview'); END; BLOCK CTOR; dojoClass = dojoDefaultClass; - visualClass = this.nodeProperty('visualClass') || 'classic'; + visualClass = this.visualClass || 'classic'; + FOREACH text IN data; + CALL this.appendChild(TPreview.new('preview', nodeValue = text )); + END; END; %] [% BLOCK RENDER %] -[% - TPreview = document.require('My/Org/TextPreview'); - FOREACH text IN data; - CALL this.appendChild(TPreview.new('preview', nodeValue = text )); - END; -%] <div class="$visualClass" data-dojo-type="$dojoClass"> [% FOREACH node IN this.selectNodes('preview') %] [% node.Render() %]