The difference between record.data and record.raw

I found that I am developing extjs applications (rally applications), which sometimes I need data from a record in a record.raw file, and not in a record.data file. What is the difference between the two, and why could this be so?

EDIT is an example of adding (a column for a sortable parent is 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; } } }, 
+4
source share
1 answer

The data in raw is raw data that has not yet been converted to the types specified in the fields configuration. As soon as a Reader does this conversion, the converted data is stored in data , which is typed based on fields .

Read more about the documents you may find the following articles: http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.data.Model

+8
source

Source: https://habr.com/ru/post/1493258/


All Articles