次のコードを使用してストアから ExtJs のフォームにデータをロードしましたが、テキスト フィールドにデータを取得できません。
Ext.onReady(function() {
var formPanel = Ext.create('Ext.form.Panel', {
title: 'Form Panel',
width: 350,
height: 200,
style: 'margin: 50px',
renderTo: 'musicianProfile', // the name of the div in my JSP
reader: new Ext.data.JsonReader({
type: 'json',
root: 'data',
fields: [
{name: 'firstName', type: 'string'},
{name: 'lastName', type: 'string'}
]
}),
items: [{
xtype: 'container',
layout: 'hbox',
items: [{
fieldLabel: 'First Name',
xtype: 'textfield',
name: 'firstName',
readOnly: true,
flex: 1,
}, {
fieldLabel: 'Last Name',
xtype: 'textfield',
name: 'lastName',
readOnly: true,
flex: 1,
}]
}]
});
formPanel.getForm().load({
method:'GET',
url:'ajax/viewMusicianMembers.htm' //URL that produces a JSON result
});
});
ブラウザに受け取る値は次のとおりです。
{
"success":true,"total":1,"message":null,
"data":[{"firstName":"System","lastName":"Administrator"}],
"errors":null
}
間違いがどこにあり、それを修正する方法を見つけるのを手伝ってくれる人はいますか?