<asp:HyperLink id="hyperlink1" NavigateUrl="~/FileExplorer/FileExplorerFeatures.aspx" Text="Open FileExplorer" runat="server"/> |
<ej:FileExplorer ID="fileexplorer1" runat="server" IsResponsive="true" Width="100%" AjaxAction="FileExplorerFeatures.aspx/FileActionDefault" Path="~/Content/images/FileExplorer" SelectedFolder="~/Content/images/FileExplorer/Nature">
<AjaxSettings>
<Download Url="downloadFile.ashx{0}" />
<Upload Url="uploadFiles.ashx{0}" />
</AjaxSettings>
</ej:FileExplorer> |
<ej:Dialog ID="dialog" Title="File Details" runat="server" ShowOnInit="false" Width="600">
<DialogContent>
<ej:FileExplorer ID="fileexplorer1" runat="server" Width="580" IsResponsive="true" AjaxAction="/FileExplorer/FileExplorerFeatures.aspx/FileActionDefault" Path="~/Content/images/FileExplorer" ClientSideOnCreate="onCreate">
<AjaxSettings>
<Download Url="downloadFile.ashx{0}" />
<Upload Url="uploadFiles.ashx{0}" />
</AjaxSettings>
</ej:FileExplorer>
</DialogContent>
</ej:Dialog>
<asp:Table ID="Table1" runat="server" Height="200" Width="500">
<asp:TableRow runat="server" BorderStyle="Solid" BorderWidth="1px">
<asp:TableCell runat="server">
<asp:HyperLink runat="server" ID="setting" ><i class="fa fa-gear"></i></asp:HyperLink>
</asp:TableCell>
<asp:TableCell runat="server">
<asp:LinkButton runat="server" ClientIDMode="Static" ID="file1" text="Nature" OnClientClick="showFile(this)"><i class="fa fa-edit"></i></asp:LinkButton>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow runat="server" BorderStyle="Solid" BorderWidth="1px">
<asp:TableCell runat="server">
<asp:LinkButton ID="file2" OnClientClick="showFile(this)" ClientIDMode="Static" runat="server"><i class="fa fa-edit"></i></asp:LinkButton>
</asp:TableCell>
</asp:TableRow>
. . . .
</asp:Table>
<script>
var diaObj, FileObj;
function onCreate(args) {
FileObj = this;
}
function showFile(e) {
var diaObj = $("#<%=dialog.ClientID%>").data("ejDialog");
console.log(e.id); //get selected link button id;
if (e.id == "file1") {
FileObj.setModel({ selectedFolder: "~/Content/images/FileExplorer/Nature" }); //set selected folder based on the link clicked.
}
else if (e.id == "file2") {
FileObj.setModel({selectedFolder:"~/Content/images/FileExplorer/Employees"})
}
else if (e.id == "file3") {
FileObj.setModel({selectedFolder:"~/Content/images/FileExplorer/Food"})
}
diaObj.open(); //open dialog with FileExplorer
FileObj.adjustSize(); //refresh FileExplorer }
</script> |