The velo function FileList adds <li> elements to a parent object, like a <ul> container FileCards. It differs from a ListGroupItem because it returns certain properties specific for FileLists.
Html
<ul id="TaskFiles-ul" velo-listitem-id="tf_id" velo-listitem-text="file1_name"
velo-listitem-displayname="displayname" velo-listitem-date="tf_datetime"></ul>
*Italic attributes are optional
*Bold attributes are mandatory
*Bold attributes are mandatory
Explanation
The velo-listitem-id attribute determines the name of the field that holds the id of the record in the return data.
The velo-listitem-text attribute determines the name of the field that holds the text, typically the file name, of the record in the return data. This item will in other words be the visible part of the list item.
Optional
The velo-listitem-displayname attribute determines the name a user that for example uploaded the file
The velo-listitem-date attribute determines a date of the upload.
JS
const tmplays = new Velo({
el: "TaskFiles-ul",
type: velo.Constants.elementtypes.FILELIST,
data: {
function: velo.Data.get.taskfiles,
input: [id]
},
onclick: "OpenTaskFile" //string with function for click on entiry <li>
buttons: [{ //buttons will be added on the right in the resulting <li>
buttonText: "X",
buttonClass: "btn btn-danger btn-sm right",
function: "DeleteTaskFile" //string with function name
}, {
buttonText: "Download",
buttonClass: "btn btn-primary btn-sm right",
function: "DownloadTaskFile"
}, {
...
}]
});