2
votes

I have a list which reads from a store whose model has a convert function on a field. The convert function returns a value that I use to control what appears in my list. This works fine the first time I load the store. The next time I load the store by setting extraParams on the store's proxy, it does not run through the convert function on the model, and therefore I am unable to update the display in my list.

Is there something I can do to ensure the model's convert function is called each time I load the store?

Thanks for your help

Example convert function:

    {
          name: 'myDisplayField',
          type: 'string',
          convert: function (value, record) {
                if (value == null) {
                      var req = record.get('otherField');
                    if (req == "valueString") {
                        value = 1;
                    }
                    else {
                        value = 0;
                    }
                        }
                        return value;
                    }
   }
1

1 Answers

0
votes

You could probably use the refresh event listener for your store and have your function called every time your store reloads. http://docs.sencha.com/touch/2-0/#!/api/Ext.data.Store-event-refresh