Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First you need to fetch the appendToMe item.</p> <pre><code>store.fetchItemByIdentity({identity : 'appendToMe', onItem : function (item) { var itemValues = store.getValues(item, 'values'); itemValues.push(someNewValue); store.setValues(item, 'values', itemValues); }}); </code></pre> <p>Then in the onItem, get your values, modify them, and then set them again using store.setValue()</p> <p>As noted, getValues needs to be used to return the array of values instead of the usual getValue, which never returns an array. And similar with setValues.</p> <p><a href="http://dojotoolkit.org/api/1.6/dojo/data/api/Read" rel="nofollow">http://dojotoolkit.org/api/1.6/dojo/data/api/Read</a></p> <blockquote> <p>This getValues() method works just like the getValue() method, but getValues() always returns an array rather than a single attribute value. The array may be empty, may contain a single attribute value, or may contain many attribute values. If the item does not have a value for the given attribute, then getValues() will return an empty array: []. (So, if store.hasAttribute(item, attribute) has a return of false, then store.getValues(item, attribute) will return [].)</p> </blockquote> <p>setValues() <a href="http://dojotoolkit.org/api/1.6/dojo/data/api/Write" rel="nofollow">http://dojotoolkit.org/api/1.6/dojo/data/api/Write</a></p> <blockquote> <p>Adds each value in the <em>values</em> array as a value of the given attribute on the given item. Replaces any previous value or values. Calling store.setValues(x, y, []) (with <em>values</em> as an empty array) has the same effect as calling store.unsetAttribute(x, y).</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload