dojox/dtl/contrib/data.js

  • Provides:

    • dojox.dtl.contrib.data
  • Requires:

    • dojox.dtl._base in common
  • dojox.dtl.contrib.data._BoundItem

    • type
      Function
    • parameters:
      • item: (typeof )
      • store: (typeof )
    • source: [view]
        this.item = item;
        this.store = store;
    • summary
  • dojox.dtl.contrib.data._BoundItem.prototype.get.safe

    • summary
  • dojox.dtl.contrib.data.BindDataNode

    • type
      Function
    • parameters:
      • items: (typeof )
      • query: (typeof )
      • store: (typeof )
      • alias: (typeof )
    • source: [view]
        this.items = items && new dd._Filter(items);
        this.query = query && new dd._Filter(query);
        this.store = new dd._Filter(store);
        this.alias = alias;
    • summary
  • dojox.dtl.contrib.data._get.safe

    • summary
  • dojox.dtl.contrib.data._BoundItem.item

    • summary
  • dojox.dtl.contrib.data._BoundItem.store

    • summary
  • dojox.dtl.contrib.data._BoundItem.get

    • type
      Function
    • parameters:
      • key: (typeof )
    • source: [view]
         var store = this.store;
         var item = this.item;


         if(key == "getLabel"){
          return store.getLabel(item);
         }else if(key == "getAttributes"){
          return store.getAttributes(item);
         }else if(key == "getIdentity"){
          if(store.getIdentity){
           return store.getIdentity(item);
          }
          return "Store has no identity API";
         }else{
          if(!store.hasAttribute(item, key)){
           if(key.slice(-1) == "s"){
            if(first){
             first = false;
             dojo.deprecated("You no longer need an extra s to call getValues, it can be figured out automatically");
            }
            key = key.slice(0, -1);
           }
           if(!store.hasAttribute(item, key)){
            return;
           }
          }


          var values = store.getValues(item, key);
          if(!values){
           return;
          }
          if(!dojo.isArray(values)){
           return new ddcd._BoundItem(values, store);
          }


          values = dojo.map(values, function(value){
           if(dojo.isObject(value) && store.isItem(value)){
            return new ddcd._BoundItem(value, store);
           }
           return value;
          });
          values.get = ddcd._get;
          return values;
         }
    • summary
  • dojox.dtl.contrib.data.BindDataNode.items

    • summary
  • dojox.dtl.contrib.data.BindDataNode.query

    • summary
  • dojox.dtl.contrib.data.BindDataNode.store

    • summary
  • dojox.dtl.contrib.data.BindDataNode.alias

    • summary
  • dojox.dtl.contrib.data.BindDataNode.render

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         var items = this.items && this.items.resolve(context);
         var query = this.query && this.query.resolve(context);
         var store = this.store.resolve(context);
         if(!store || !store.getFeatures){
          throw new Error("data_bind didn't receive a store");
         }


         if(query){
          var sync = false;


          store.fetch({
           query: query,
           sync: true,
           scope: this,
           onComplete: function(it){
            sync = true;
            items = it;
           }
          });


          if(!sync){
           throw new Error("The bind_data tag only works with a query if the store executed synchronously");
          }
         }


         var list = [];


         if(items){
          for(var i = 0, item; item = items[i]; i++){
           list.push(new ddcd._BoundItem(item, store));
          }
         }


         context[this.alias] = list;
         return buffer;
    • summary
  • dojox.dtl.contrib.data.BindDataNode.unrender

    • type
      Function
    • parameters:
      • context: (typeof )
      • buffer: (typeof )
    • source: [view]
         return buffer;
    • summary
  • dojox.dtl.contrib.data.BindDataNode.clone

    • type
      Function
    • source: [view]
         return this;
    • summary
  • dojox.dtl.contrib.data

    • type
      Object
    • summary
  • dojox.dtl.contrib

    • type
      Object
    • summary
  • dojox.dtl

    • type
      Object
    • summary
  • dojox

    • type
      Object
    • summary