0

I use a grouping feature on my grid. When I click on a group I simply iterate through my store and change some properties using set. But the attribute doesn't get set no matter what.. Here is my code:

onGroupClick(node, view, group){

    var store = Ext.getStore('someStore');

    store.data.each(function(item, index, totalItems ) {
        if (item.data.id == somecondition ){
            item.set('displayName', 'someName'); //DOES NOT WORK        
        }
    });
} 

EDIT: the field being set uses a converter.

ekad
  • 14,436
  • 26
  • 44
  • 46
Jacob
  • 3,580
  • 22
  • 82
  • 146
  • I don't know if this would cause the issue. Does making the `each` method `store.each(function(item){});` effect? I'm seeing that it is possible to use each at the [store level in the docs](http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.data.Store-method-each). – weeksdev Feb 04 '14 at 14:25
  • Is there any alternative option? – Jacob Feb 04 '14 at 14:34
  • An alternative is `Ext.Array.each(store.data.items,function(item){});` – weeksdev Feb 04 '14 at 14:36
  • Sorry, I did not help! – Jacob Feb 04 '14 at 14:40
  • Could try setting it directly, `item.data.displayName = 'someName'`? Additionally, are you positive that the condition is being met in the `if` statment? – weeksdev Feb 04 '14 at 14:44
  • The condition is not the problem. The way you described now is wrong for many reasons I believe and it does not work either... – Jacob Feb 04 '14 at 14:53
  • right, you should use `set()` however, i was curious if setting directly got diff outcome. Is there any error reported in console? – weeksdev Feb 05 '14 at 23:33
  • Perhaps the problem is in the field converter code. Could you post that? – Kevin Collins Aug 01 '17 at 12:15

0 Answers0