source: Dev/trunk/src/client/dojox/mvc/Templated.js @ 532

Last change on this file since 532 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 1.2 KB
Line 
1define([
2        "dojo/_base/declare",
3        "dojo/_base/lang",
4        "dijit/_WidgetBase",
5        "dijit/_TemplatedMixin",
6        "dijit/_WidgetsInTemplateMixin",
7        "./at"
8], function(declare, lang, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin){
9        return declare("dojox.mvc.Templated", [_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin], {
10                // summary:
11                //              A templated widget, mostly the same as dijit/_Templated, but without deprecated features in it.
12
13                // bindings: Object|Function
14                //              The data binding declaration (or simple parameters) for child widgets.
15                bindings: null,
16
17                startup: function(){
18                        // Code to support childBindings property in dojox/mvc/WidgetList, etc.
19                        // This implementation makes sure childBindings is set before this widget starts up, as dijit/_WidgetsInTemplatedMixin starts up child widgets before it starts itself up.
20                        var bindings = lang.isFunction(this.bindings) && this.bindings.call(this) || this.bindings;
21                        for(var s in bindings){
22                                var w = this[s], props = bindings[s];
23                                if(w){
24                                        for(var prop in props){
25                                                w.set(prop, props[prop]);
26                                        }
27                                }else{
28                                        console.warn("Widget with the following attach point was not found: " + s);
29                                }
30                        }
31                        this.inherited(arguments);
32                }
33        });
34});
Note: See TracBrowser for help on using the repository browser.