0

I designing edit form using fieldset. For example,

items: [
    {
        xtype: 'textfield',
        name: 'nameEn',
        label: 'Name (English)',
        placeholder: '',
        autoCapitalize: false,
        required: true,
        clearIcon: true
    },
    {
        xtype: 'textareafield',
        name: 'descriptionEn',
        label: 'Description (English)'
    },
    {
        xtype: 'togglefield',
        name: 'verified',
        label: 'Verified'
    }
]

And now I need photos (for view, but upload/remove is possible in future). I have no idea what to do.

indapublic
  • 2,208
  • 9
  • 38
  • 49

1 Answers1

1

Well, for display you can use the xtype:image (documentation here), and for upload you can use the xtype:textfield with an inputType:'file' property. However, you should note that on iOS you may not be able to do file upload without packaging an app (as mentioned in this forum post). If you want users to be able to take a picture with the camera you can use a button, and in the handler use the Ext.device.Camera component.

If you want multiple photos you may want to use an hbox layout around your image components.

Good luck!

EDIT: Here's an example of a panel with an hbox layout and horizontal scrolling. Basically, the simplest image gallery you can make in Sencha Touch (I think):

{
  xtype: 'panel',
  layout: 'hbox',
  scrollable: { direction: 'horizontal' },
  items: [
    {
      xtype: 'image',
      src: 'path/to/image.png'
    },
    {
      xtype: 'image',
      src: 'path/to/another/image.jpg'
    },
    ...
  ]
}
Jordan Kasper
  • 13,153
  • 3
  • 36
  • 55