2

ビューに画像を表示しようとしています。画像のソースは私のモデルのフィールドにあり、base64 文字列形式です。このフィールドを画像 src に割り当てる必要があります。画像に静的な Base 64 コンテンツを設定しようとすると正常に動作しますが、フィールドを割り当てて動的に割り当てようとすると、ビューが空白になります。

以下のコードをご覧ください

Image base64 ベースのコンテンツは、「添付ファイル」フィールドに表示されます。

私のビューコード

 Ext.define('TechHelp.view.ViewAttachment',
            {
                xtype : 'viewattachment',
                  extend : "Ext.form.Panel",
                requires :"Ext.form.FieldSet" ,

      config : {
                    //styleHtmlContent : true,
                    scrollable : 'vertical',
                    title : 'Attachments',
    items : [{
        xtype : "image",
       name : 'attachment',
       src: 'data:image/jpeg;base64,'+'Attachment',
           height:'100px',
       width: '100px'
}, ]
 },

 });

私のモデルコード

Ext.define('TechHelp.model.Attachment', { 拡張: 'Ext.data.Model',

config: {
    // define the fields. the default type is string

    fields:// ['customerId','FirstName'],
          [{name:'AttachmentId'},
           {name:'TicketId'},
           {name:'Attachment'},
           {name:'FileName'},
           ],

},

});

助けてください。

4

1 に答える 1