これらの値をjsonから解析しているときに値がExtjsのグリッドでnullになっていますが、これは基本的にプロパティラベルがドットであるためです。Extjsのドット表記で変数を解析する
"properties": {
"financialYear": "2009",
"employee.employeeId": "12345",
"employee.employeeName": "abc"
}
Extjsグリッドに.jsのemployee.employeeId値を表示するにはどうすればよいですか。
今私は、.jsファイルに次のように
Ext.define('DocProperties',{
extend: 'Ext.data.Model',
fields: [
{name: 'financialYear', type: 'string'},
{name:'employeeId', mapping:'properties.employee.employeeId',type: 'string'},
]});
をマッピングしていますし、グリッドパネルの表示のために私は、この、このため
{
width:100,
header: "Employee ID",
dataIndex: 'employeeId',
sortable: true
}
任意のソリューションまたは回避策のようにアクセスしていますが。
@DmitryBのおかげで、しかし、これは私の問題を解決していなかった、私はこの
Ext.onReady(function() {
var store = Ext.create('Ext.data.Store', {
model: 'DocResult',
autoLoad: true,
proxy: {
type: 'rest',
url : 'sample-data.json',
reader: {
type: 'json',
root: 'results',
useSimpleAccessors: true
}
}
});
のような、私のモデルで私の店は、私はまた、この
Ext.define('DocResult',{
extend: 'Ext.data.Model',
fields: [
{name: 'id', type: 'int'},
{name:'employeeId', mapping:'properties.employee.employeeId',type: 'string'}
] });
と同様に定義されていExtグリッドディスプレイに空の値が表示されます。助けてください。
こんにちはBigSean ...ありがとうたくさん...あなたが言ったようにuseSimpleAccessorsをfalseとマッピングに設定することによって働きました.Thanks a ton !!!! – maanoor99