int型のフィールドにハタが含まれているJsonストアから読み取ったリストがあります。このフィールドは、以下のサンプルモデルでは「req」と呼ばれます。ただし、int値でグループ化するのではなく、代わりにテキスト値を割り当てたいので、たとえば、「1」の場合は「はい」でグループ化し、「0」の場合は「いいえ」でグループ化します。 "。変換は変更されないため、ハードコーディングできます。コードのどこでこの変換を行いますか?ご協力いただきありがとうございます
Ext.define('MyApp.store.MyStore', {
extend: 'Ext.data.Store',
requires: [
'MyApp.model.MyData'
],
config: {
model: 'MyApp.model.MyData',
storeId: 'MyStore',
proxy: {
type: 'ajax',
url: '/path/to/data.json',
reader: {
type: 'json',
rootProperty: 'items'
}
},
grouper: {
property: 'req',
sortProperty: 'req'
},
groupDir: 'DESC'
}
});
モデル:
Ext.define('Mypp.model.MyModel', {
extend: 'Ext.data.Model',
config: {
fields: [
{
name: 'example',
type: 'string'
},
{
name: 'req',
type: 'int'
}
]
}
});