Lines Matching refs:key
37 * Initial state to set, as an object hash of key/value pairs. This will be
222 * key is the item key, and the value is an object containing
231 * Object hash of key/value pairs of all state items after the
237 * Object hash of key/value pairs of all state items before the
243 * Object hash of key/value pairs of state items that have been
271 * <code>undefined</code> value will cause that key to be removed from the
275 * @param {Object} state Object hash of key/value pairs.
302 * Adds a state entry with a new value for a single key. By default, the new
304 * existing value with the same key if there is one. Specifying a
305 * <code>null</code> or <code>undefined</code> value will cause the key to
309 * @param {String} key State parameter key.
315 addValue: function (key, value, options) {
317 state[key] = value;
322 * Returns the current value of the state parameter specified by <i>key</i>,
323 * or an object hash of key/value pairs for all current state parameters if
324 * no key is specified.
327 * @param {String} key (optional) State parameter key.
329 * object hash of key/value pairs for all current state parameters.
331 get: function (key) {
335 if (key) {
336 return isObject && Obj.owns(state, key) ? state[key] : undefined;
348 * @param {Object} state Object hash of key/value pairs.
365 * @param {String} key State parameter key.
371 replaceValue: function (key, value, options) {
373 state[key] = value;
386 * @param {Object} state Object hash of key/value pairs.
428 Obj.each(changes.changed, function (value, key) {
429 this._fireChangeEvent(src, key, value);
432 Obj.each(changes.removed, function (value, key) {
433 this._fireRemoveEvent(src, key, value);
438 * Fires a dynamic "[key]Change" event.
443 * @param {String} key key of the item that was changed
448 _fireChangeEvent: function (src, key, value) {
452 * changed. The name of this event depends on the name of the key that
453 * changed. To listen to change events for a key named "foo", subscribe
454 * to the <code>fooChange</code> event; for a key named "bar", subscribe
465 * @event [key]Change
489 this.fire(key + 'Change', {
497 * Fires a dynamic "[key]Remove" event.
502 * @param {String} key key of the item that was removed
506 _fireRemoveEvent: function (src, key, value) {
510 * name of this event depends on the name of the key that was removed.
511 * To listen to remove events for a key named "foo", subscribe to the
512 * <code>fooRemove</code> event; for a key named "bar", subscribe to
523 * @event [key]Remove
540 this.fire(key + 'Remove', {
553 * @param {Object} newState object hash of key/value pairs representing the
570 Obj.each(newState, function (newVal, key) {
571 var prevVal = prevState[key];
574 changed[key] = {
584 Obj.each(prevState, function (prevVal, key) {
585 if (!Obj.owns(newState, key) || newState[key] === null) {
586 delete newState[key];
587 removed[key] = prevVal;