1
2
3
4
5
6
| //>>built
| define(["dojo/_base/kernel","dojo/_base/lang","../_base","dojo/_base/array"],function(l,d,f,m){var c=d.getObject("contrib.data",!0,f),h=!0;c._BoundItem=d.extend(function(a,b){this.item=a;this.store=b},{get:function(a){var b=this.store,e=this.item;if("getLabel"==a)return b.getLabel(e);if("getAttributes"==a)return b.getAttributes(e);if("getIdentity"==a)return b.getIdentity?b.getIdentity(e):"Store has no identity API";if(!b.hasAttribute(e,a)&&("s"==a.slice(-1)&&(h&&(h=!1,l.deprecated("You no longer need an extra s to call getValues, it can be figured out automatically")),
| a=a.slice(0,-1)),!b.hasAttribute(e,a)))return;if(a=b.getValues(e,a)){if(!d.isArray(a))return new c._BoundItem(a,b);a=m.map(a,function(a){return d.isObject(a)&&b.isItem(a)?new c._BoundItem(a,b):a});a.get=c._get;return a}}});c._BoundItem.prototype.get.safe=!0;c.BindDataNode=d.extend(function(a,b,c,g){this.items=a&&new f._Filter(a);this.query=b&&new f._Filter(b);this.store=new f._Filter(c);this.alias=g},{render:function(a,b){var e=this.items&&this.items.resolve(a),g=this.query&&this.query.resolve(a),
| d=this.store.resolve(a);if(!d||!d.getFeatures)throw Error("data_bind didn't receive a store");if(g){var f=!1;d.fetch({query:g,sync:!0,scope:this,onComplete:function(a){f=!0;e=a}});if(!f)throw Error("The bind_data tag only works with a query if the store executed synchronously");}g=[];if(e)for(var h=0,k;k=e[h];h++)g.push(new c._BoundItem(k,d));a[this.alias]=g;return b},unrender:function(a,b){return b},clone:function(){return this}});d.mixin(c,{_get:function(a){if(this.length)return this[0]instanceof
| c._BoundItem?this[0].get(a):this[0][a]},bind_data:function(a,b){a=b.contents.split();if("to"!=a[2]||"as"!=a[4]||!a[5])throw Error("data_bind expects the format: 'data_bind items to store as varName'");return new c.BindDataNode(a[1],null,a[3],a[5])},bind_query:function(a,b){a=b.contents.split();if("to"!=a[2]||"as"!=a[4]||!a[5])throw Error("data_bind expects the format: 'bind_query query to store as varName'");return new c.BindDataNode(null,a[1],a[3],a[5])}});c._get.safe=!0;f.register.tags("dojox.dtl.contrib",
| {data:["bind_data","bind_query"]});return c});
|
|