Lines Matching refs:key
35 * Initial state to set, as an object hash of key/value pairs. This will be
220 * key is the item key, and the value is an object containing
229 * Object hash of key/value pairs of all state items after the
235 * Object hash of key/value pairs of all state items before the
241 * Object hash of key/value pairs of state items that have been
269 * <code>undefined</code> value will cause that key to be removed from the
273 * @param {Object} state Object hash of key/value pairs.
300 * Adds a state entry with a new value for a single key. By default, the new
302 * existing value with the same key if there is one. Specifying a
303 * <code>null</code> or <code>undefined</code> value will cause the key to
307 * @param {String} key State parameter key.
313 addValue: function (key, value, options) {
315 state[key] = value;
320 * Returns the current value of the state parameter specified by <i>key</i>,
321 * or an object hash of key/value pairs for all current state parameters if
322 * no key is specified.
325 * @param {String} key (optional) State parameter key.
327 * object hash of key/value pairs for all current state parameters.
329 get: function (key) {
333 if (key) {
334 return isObject && Obj.owns(state, key) ? state[key] : undefined;
346 * @param {Object} state Object hash of key/value pairs.
363 * @param {String} key State parameter key.
369 replaceValue: function (key, value, options) {
371 state[key] = value;
384 * @param {Object} state Object hash of key/value pairs.
426 Obj.each(changes.changed, function (value, key) {
427 this._fireChangeEvent(src, key, value);
430 Obj.each(changes.removed, function (value, key) {
431 this._fireRemoveEvent(src, key, value);
436 * Fires a dynamic "[key]Change" event.
441 * @param {String} key key of the item that was changed
446 _fireChangeEvent: function (src, key, value) {
450 * changed. The name of this event depends on the name of the key that
451 * changed. To listen to change events for a key named "foo", subscribe
452 * to the <code>fooChange</code> event; for a key named "bar", subscribe
463 * @event [key]Change
487 this.fire(key + 'Change', {
495 * Fires a dynamic "[key]Remove" event.
500 * @param {String} key key of the item that was removed
504 _fireRemoveEvent: function (src, key, value) {
508 * name of this event depends on the name of the key that was removed.
509 * To listen to remove events for a key named "foo", subscribe to the
510 * <code>fooRemove</code> event; for a key named "bar", subscribe to
521 * @event [key]Remove
538 this.fire(key + 'Remove', {
551 * @param {Object} newState object hash of key/value pairs representing the
568 Obj.each(newState, function (newVal, key) {
569 var prevVal = prevState[key];
572 changed[key] = {
582 Obj.each(prevState, function (prevVal, key) {
583 if (!Obj.owns(newState, key) || newState[key] === null) {
584 delete newState[key];
585 removed[key] = prevVal;