Created
June 23, 2019 15:55
-
-
Save arun12209/b3624c4e05110fef3dba1a0cdafbe49c to your computer and use it in GitHub Desktop.
FileUploaderCmp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component controller="SimplyfyFilesCntrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" > | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/> | |
<aura:attribute name="files" type="ContentDocument[]"/> | |
<aura:attribute name="recordId" type="string"/> | |
<aura:attribute name="accept" type="List" default="['.jpg', '.jpeg','.pdf','.csv','.xlsx']"/> | |
<aura:attribute name="multiple" type="Boolean" default="true"/> | |
<aura:attribute name="disabled" type="Boolean" default="false"/> | |
<div class="slds"> | |
<div style="border-left: 1px solid rgb(221, 219, 218); | |
border-right: 1px solid rgb(221, 219, 218); | |
border-bottom: 1px solid rgb(221, 219, 218); | |
border-top: 1px solid rgb(221, 219, 218);"> | |
<div class="slds-page-header" style="border-radius: 0px; border-right: 0px;border-left: 0px;border-top: 0px; | |
box-shadow: 0 0px 0px 0 rgba(0, 0, 0, 0.1);"> | |
Files | |
</div> | |
<div class="slds-grid"> | |
<div class="slds-col slds-size--5-of-12"> | |
<lightning:input type="text" name="input1" label="Enter File Name" aura:id="fileName" /> | |
</div> | |
<div class="slds-col slds-size---of-12"> | |
<lightning:fileUpload label="" multiple="{!v.multiple}" | |
accept="{!v.accept}" recordId="{!v.recordId}" | |
onuploadfinished="{!c.UploadFinished}" /> | |
</div> | |
</div><br/> | |
<table class="slds-table slds-table--bordered"> | |
<thead> | |
<tr> | |
<th>Title</th> | |
<th>FileType</th> | |
<th>Description</th> | |
</tr> | |
</thead> | |
<tbody> | |
<aura:iteration items="{!v.files}" var="f"> | |
<tr> | |
<td> <a href="" id="{!f.Id}" onclick="{!c.OpenFile}">{!f.Title}</a></td> | |
<td>{!f.FileType}</td> | |
<td>{!f.Description}</td> | |
</tr> | |
</aura:iteration> | |
</tbody> | |
</table> | |
</div> | |
</div> | |
</aura:component> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment