Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to update Record with local storage adapter
    primarykey
    data
    text
    <p>for local storage adapter im using <a href="https://github.com/rpflorence/ember-localstorage-adapter" rel="nofollow">LSA</a> now i want to updata a model with id of 'ab12' in my model but i dont know how to dow it . my model is :</p> <pre><code>OlapApp.AxisModel = DS.Model.extend({ uniqueName: DS.attr('string'), name: DS.attr('string'), hierarchyUniqueName: DS.attr('string'), type: DS.attr('string'),//row,column,filter isMeasure: DS.attr('boolean'), isActive:DS.attr('boolean'), //is added to one of type orderId: DS.attr('number') }); </code></pre> <p>im my controller im trying :</p> <pre><code>this.get('store').updateRecord('axisModel',{ id:item.get('id'), orderId:index }); </code></pre> <p>but i get an error : </p> <pre><code>Uncaught TypeError: Object [object Object] has no method 'updateRecord' </code></pre> <p>i need to update orderId in model.and if im using commit() i get an error :</p> <pre><code> updateSortOrder: function(indexes) { var store = this.get('store'); this.get('getRowItem').forEach(function(item) { var index = indexes[item.get('id')]; if($.isEmptyObject(indexes)) index=0; item.set('orderId', index); store.commit(); }, this); }, </code></pre> <p>the error is : </p> <pre><code>Uncaught TypeError: Object [object Object] has no method 'commit' </code></pre> <p>and this is <code>getRowItem</code> :</p> <pre><code>getRowItem: function(controller, model) { return this.get('model').filterProperty('type', 'row'); }.property('model.@each.type'), </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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