Last updated
Was this helpful?
Was this helpful?
title: Delete Invoice
description: Delete a specific invoice
type: jig.list
header:
type: component.jig-header
options:
height: medium
children:
type: component.image
options:
source:
uri: https://builder.jigx.com/assets/images/header.jpg
onFocus:
type: action.sync-entities
options:
# reference the OneDrive provider to sync the folder meta data to the local data
# provider.
provider: DATA_PROVIDER_ONEDRIVE
entities:
- entity: myfiles
data:
tokenType: jigx.graph.oauth
datasources:
file-data-myfiles:
type: datasource.sqlite
options:
# store the files metadata from OneDrive using local data provider
provider: DATA_PROVIDER_LOCAL
# reference the path on OneDrive where the files are located
entities:
- myfiles
# use the name and id to return in the list
query: SELECT id, '$.name' as name FROM [myfiles] ORDER BY '$.name' DESC
data: =@ctx.datasources.file-data-myfiles
item:
type: component.list-item
instanceId: =@ctx.current.item.id
options:
title: =@ctx.current.item.name
swipeable:
left:
- label: Delete
color: negative
onPress:
type: action.confirm
options:
isConfirmedAutomatically: false
onConfirmed:
type: action.execute-entity
options:
# reference the OneDrive data provider
provider: DATA_PROVIDER_ONEDRIVE
entity: myfiles
method: delete
data:
tokenType: jigx.graph.oauth
id: =@ctx.current.item.id
onSuccess:
title: File Deleted
# confirm that file must be deleted using a modal
modal:
title: Are you sure you want to delete this file?