Lines Matching refs:name

28          * @param name {String} The name of the item.
29 * @param key {String} The name of the property.
32 add : function(name, key, val) {
34 d[name] = d[name] || {};
35 d[name][key] = val;
42 * @param name {String} The name of the item.
45 addAll: function(name, o) {
50 this.add(name, key, o[key]);
59 * @param name {String} The name of the item.
62 remove: function(name, key) {
64 if (d[name]) {
65 delete d[name][key];
73 * @param name {String} The name of the item.
76 removeAll: function(name, o) {
80 if (d[name]) {
81 delete d[name];
86 this.remove(name, k);
88 this.remove(name, v);
98 * @param name {String} The name of the item
102 get: function(name, key) {
104 return (d[name]) ? d[name][key] : undefined;
115 * @param name {String} The name of the item
120 getAll : function(name, reference) {
124 Y.each(d[name], function(v, k) {
129 o = d[name];
139 * but can also be used independently to provide a name/property/value data structure to
278 * <p>valueFn can also be set to a string, representing the name of the instance method to be used to retrieve the value.</p>
302 * <p>setter can also be set to a string, representing the name of the instance method to be used as the setter function.</p>
313 * <p>getter can also be set to a string, representing the name of the instance method to be used as the getter function.</p>
323 * <p>validator can also be set to a string, representing the name of the instance method to be used as the validator function.</p>
333 * <p>The setter, getter and validator are invoked with the value and name passed in as the first and second arguments, and with
341 * @param {String} name The name of the attribute.
355 addAttr: function(name, config, lazy) {
357 Y.log('Adding attribute: ' + name, 'info', 'attribute');
368 if (lazy && !host.attrAdded(name)) {
369 state.addAll(name, {
375 if (host.attrAdded(name) && !state.get(name, IS_LAZY_ADD)) { Y.log('Attribute: ' + name + ' already exists. Cannot add it again without removing it first', 'warn', 'attribute'); }
377 if (!host.attrAdded(name) || state.get(name, IS_LAZY_ADD)) {
381 if (config.readOnly && !hasValue) { Y.log('readOnly attribute: ' + name + ', added without an initial value. Value will be set on initial call to set', 'warn', 'attribute');}
392 state.addAll(name, config);
396 host.set(name, value);
399 state.remove(name, INITIALIZING);
410 * @param {String} name The name of the attribute to check.
411 * @return {boolean} true if an attribute with the given name has been added, false if it hasn't. This method will return true for lazily added attributes.
413 attrAdded: function(name) {
414 return !!this._state.get(name, ADDED);
424 * @param {String} name The name of the attribute. If the value of the attribute is an Object,
429 get : function(name) {
430 return this._getAttr(name);
439 * @param {String} name The name of the attribute
442 _isLazyAttr: function(name) {
443 return this._state.get(name, LAZY);
451 * @param {Object} name The name of the attribute
453 _addLazyAttr: function(name, cfg) {
455 lazyCfg = state.get(name, LAZY);
457 state.add(name, IS_LAZY_ADD, true);
458 state.remove(name, LAZY);
459 this.addAttr(name, lazyCfg);
468 * @param {String} name The name of the attribute. If the
476 set : function(name, val) {
477 return this._setAttr(name, val);
487 * @param {String} name The name of the attribute.
491 _set : function(name, val) {
492 return this._setAttr(name, val, null, true);
504 * @param {String} name The name of the attribute.
516 _setAttr : function(name, val, opts, force) {
533 if (name.indexOf(DOT) !== -1) {
534 strPath = name;
535 path = name.split(DOT);
536 name = path.shift();
539 if (this._isLazyAttr(name)) {
540 this._addLazyAttr(name);
543 cfg = state.getAll(name, true) || {};
547 if (stateProxy && name in stateProxy && !cfg._bypassProxy) {
558 Y.log('Set attribute:' + name + ', aborted; Attribute is writeOnce', 'warn', 'attribute');
563 Y.log('Set attribute:' + name + ', aborted; Attribute is readOnly', 'warn', 'attribute');
569 Y.log('Set attribute:' + name + ', aborted; Attribute is writeOnce: "initOnly"', 'warn', 'attribute');
576 currVal = this.get(name);
590 this._setAttrVal(name, strPath, currVal, val);
594 this._fireAttrChange(name, strPath, currVal, val, opts);
612 * @param {String} name The name of the attribute.
615 _getAttr : function(name) {
617 fullName = name,
624 if (name.indexOf(DOT) !== -1) {
625 path = name.split(DOT);
626 name = path.shift();
630 if (host._tCfgs && host._tCfgs[name]) {
632 cfg[name] = host._tCfgs[name];
633 delete host._tCfgs[name];
638 if (host._isLazyAttr(name)) {
639 host._addLazyAttr(name);
642 val = host._getStateVal(name);
644 getter = state.get(name, GETTER);
662 * @param {String} name The name of the attribute
665 _getStateVal : function(name) {
667 return stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY) ? stateProxy[name] : this._state.get(name, VALUE);
676 * @param {String} name The name of the attribute
679 _setStateVal : function(name, value) {
681 if (stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY)) {
682 stateProxy[name] = value;
684 this._state.add(name, VALUE, value);
694 * @param {String} attrName The attribute name.
695 * @param {String} subAttrName The sub-attribute name, if setting a sub-attribute property ("x.y.z").
710 name = subAttrName || attrName,
720 valid = validator.call(host, newVal, name);
736 retVal = setter.call(host, newVal, name);
773 * @param {Object} attrs An object with attributes name/value pairs.
786 * @param {Object} attrs An object with attributes name/value pairs.
805 * @return {Object} An object with attribute name/value pairs.
818 * @return {Object} An object with attribute name/value pairs.
853 * @param {Object} cfgs An object with attribute name/configuration pairs.
854 * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.
884 * @param {Object} cfgs An object with attribute name/configuration pairs.
885 * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply.
947 * @param {Object} valueHash An object with attribute name/value pairs
963 * @param {String} attr The name of the attribute
965 * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals