ExtJS4.1。
何らかの形があると想像してみましょう。
Ext.define('App.view.editform', {
extend: 'Ext.form.Basic',
defaultType: 'textfield',
items: [
{
fieldLabel: 'Title',
name: 'title',
allowBlank: false,
}, {
xtype: 'textarea',
fieldLabel: 'Text',
name: 'text',
height: 160,
}, {
xtype: 'filefield',
fieldLabel: 'Image',
name: 'image',
}, {
xtype: 'hidden',
name: 'id',
},
],
});
とストア:
Ext.define('App.store.Store', {
extend: 'Ext.data.Store',
model: new Ext.data.Model({
fields: [
{name: 'id', type: 'int'},
{name: 'title', type: 'string'},
{name: 'text', type: 'string'},
],
proxy: {
type: 'ajax',
url: '/someurl',
reader: {
type: 'json',
root: 'results'
},
},
}),
autoLoad: true,
autoSync: true,
});
で変更するRecords
には、フォームのメソッドとメソッドをStore
使用して、変更を(サーバーに)送信します。しかし、サーバーではすべてに画像が関連付けられています。loadRecord();
updateRecord();
Store
Record
updateRecord();
メソッドは、テキストフィールドのみをに送信しますStore
。タイプフィールドModel
を含めることはできません。binary
では、formsメソッドを使用して画像をアップロードする方法はありupdateRecord();
ますか?