attachment

attachment is a juci widget built for adding multiple photos from the device using $m APIs in a user friendly and easy manner. This can be used to collect and attach multiple items to a form.

  • Extends xlist
  • Syntax

    <div data-juci="attachment" data-label="Attach!"></div>
    <div data-juci="attachment" data-label="Attachment" data-bind="ref: atc"></div>
    <div data-juci="attachment" data-bind="ref: atcuris" data-uri="true" data-label="Attachments with URI!"></div>
    Requires mowbly to be loaded.

    Attributes

    • data-img {String}
      Name of reference or an expression with the reference, defined using juci#addDataset. Appears as an image in each attached item.
    • data-img-onerror {String}
      Name of function defined on the window scope. Added as a listener for attachment#event:imageerror.
    • data-img-onload {String}
      Name of function defined on the window scope. Added as a listener for attachment#event:imageload.
    • data-photo-options {Object}
      Configuration for the photo
      data-photo-options="width: 200, height: 100"
      See:
      $m.choosePic
    • data-img-css {String}
      CSS class for the image. See css expression binding
    • data-uri {Boolean}
      True for data uri string, else URL reference by default.
    • data-title {String}
      Name of reference or an expression with the reference, defined using juci#addDataset. Appears as a title in each attached item.
    • data-juci {String}
      A string with value attachment.

    Events

    • addclick(eventObj) Cancellable
      Fires when the user has clicked on "Add".
      Parameters:
    • cancel(eventObj)
      Fires when the user has cancelled choosing or taking a picture. Can be used to update user interface.
      Parameters:
    • finish(eventObj)
      Fires after the user has chosen or taken a picture successfully. Can be used to update user interface.
      Parameters:
    • imageerror(eventObj)
      Fires when an image in a list item has finished loading with errors.
      Parameters:
      This event cannot be listened to in html through onimageerror. Use data-img-on-error.
    • imageload(eventObj)
      Fires when an image in a list item has finished loading.
      Parameters:
      This event cannot be listened to in html through onimageload. Use data-img-on-load.
    • itemselect(eventObj)
      Fires when the user has clicked on an item in the attachment list.
      Parameters:
      • eventObj{EventObject}
        • index{Number}
          Index of the item.
        • item{Object}
          The item that has been selected.
        • listItem{juci.listItem}
          The element that has been selected.
    • photooptions(eventObj)
      Fires before the user is directed to the camera or a gallery.
      Parameters:
      • eventObj{EventObject}
        • options{Object}
          The configuration for $m.choosePic() and $m.capturePic().
    • start(eventObj)
      Fires when the user taps on the add to start choosing or taking a picture. Can be used to update user interface.
      Parameters: