Difference between record.data and record.raw

extjs, rally

Solution

The data in `raw` is the raw data that has yet to be converted into the types specified in the `fields` config. Once a `Reader` does that conversion, the converted data is stored in `data`, which is typed based on the `fields`.

You can learn more from the docs about these here: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.Model

Problem

I have found as I am developing extjs applications (rally applications) that sometimes the data I need from a record is in record.raw and not in record.data. What is the difference between the two, and why might this be the case? EDIT - adding example (a column for the parent that is sortable - one of my other questions) ``` {text: 'Parent', dataIndex: 'Parent', doSort: function(state) { var ds = this.up('grid').getStore(); var field = this.getSortParam(); ds.sort({ property: field, direction: state, sorterFn: function(v1, v2){ if (v1.raw.Parent) { v1 = v1.raw.Parent.Name; } else { v1 = v1.data.Name; } if (v2.raw.Parent) { v2 = v2.raw.Parent.Name; } else { v2 = v2.data.Name; } return v1.localeCompare(v2); } }); }, renderer: function(value, meta, record) { var ret = record.raw.Parent; if (ret) { return ret.Name; } else { meta.tdCls = 'invisible'; return record.data.Name; } } }, ```

Original source