@(Html.EJ().FileExplorer("fileExplorer")
.FileTypes("*.png, *.gif, *.jpg, *.jpeg, *.docx, *.pdf")
.Layout(LayoutType.Tile)
.Path("/FileExplorerContent/")
.AjaxAction(@Url.Action("FileActionDefault"))
.SelectedFolder("/FileExplorerContent/Food/")
.Width("100%")
.IsResponsive(true)
.MinWidth("350px")
) |
@{Html.EJ().Dialog("feDialog").Title("FileExplorer_Dialog").ShowOnInit(false).ContentTemplate(
@<div>
@(Html.EJ().FileExplorer("fileExplorer")
.FileTypes("*.png, *.gif, *.jpg, *.jpeg, *.docx, *.pdf")
.Layout(LayoutType.Tile)
.Path(@Url.Content("~/FileExplorerContent/"))
.AjaxAction(@Url.Action("FileActionDefault"))
.SelectedFolder("/FileExplorerContent/Food/")
.Width("100%")
.IsResponsive(true)
.MinWidth("350px")
.ClientSideEvents(eve => eve.Create("onCreate").BeforeOpen("onBeforeOpen"))
)
</div>).Width(900).MinWidth(500).MinHeight(400).Height(500).ClientSideEvents(eve => eve.Open("adjustSize").Resize("adjustSize")).Render();}
<script type="text/javascript">
function adjustSize(args) {
$("#fileExplorer").data("ejFileExplorer").adjustSize();
}
</script> |
@Html.EJ().DropDownList("selectFolder").TargetID("folderList").Width("300px").WatermarkText("Select a folder").ClientSideEvents(eve => eve.Select("onSelect"))
<div id="folderList">
<ul>
<li>/FileExplorerContent/Food/</li>
<li>/FileExplorerContent/Employees/</li>
<li>/FileExplorerContent/Nature/</li>
</ul>
</div>
<script type="text/javascript">
function onSelect(args) {
$("#feDialog").data("ejDialog").open();
$("#fileExplorer").data("ejFileExplorer").option("selectedFolder", args.value);
}
</script> |
@Html.EJ().Button("btnOpen").Text("Click to open Order folder").ClientSideEvents(evt => evt.Click("onclick")) <div class="control" > @{Html.EJ().Dialog("basicDialog").Title("PO Folder").ShowOnInit(false).Containment(".control").ContentTemplate( @<div> @(Html.EJ().FileExplorer("fileExplorer") .FileTypes("*.png, *.gif, *.jpg, *.jpeg, *.docx, *.pdf") .Layout(LayoutType.Tile) .Path(@Url.Content("~/FileExplorerContent/")) .AjaxAction(@Url.Action("FileActionDefault")) .Width("100%").Height("500") .IsResponsive(true) .MinWidth("350px") .ClientSideEvents(eve => eve.Create("onCreate").BeforeOpen("onBeforeOpen")) ) </div> ).Width("95%").Height("95%") .Target(".control") .IsResponsive(true) .EnableResize() .ClientSideEvents(evt => evt.Close("onDialogClose")).Render();} </div> <script> function getCustomer() { $.ajax({ url: '@Url.Action("GetCustomerName")', dataType: "json", data: { 'ord': $("#Order").data("ejDropDownList").text()}, type: "POST", success: function (result) { alert(data); } }); } function onclick() { $("#basicDialog").ejDialog("open"); $("#fileExplorer").data("ejFileExplorer").option("selectedFolder", "/FileExplorerContent/" + getCustomer() +"/"); $("#btnOpen").hide(); } function onDialogClose(args) { $("#btnOpen").show(); } </script> |
[HttpGet] public JsonResult GetCustomerName(string ord) { var customer = db.tableData.Where(p => p.Order == ord) .Select(u => u.CustomerName) .FirstOrDefault(); return Json(customer, JsonRequestBehavior.AllowGet); } |
$("#fileExplorer").data("ejFileExplorer").option("selectedFolder", "/FileExplorerContent/" + getCustomer() +"/"); |
function getCustomer() {
$.ajax({
url: '@Url.Action("GetCustomerName")',
dataType: "json",
data: { 'ord': $("#Order").data("ejDropDownList").value() },
type: "POST",
success: function (result) {
//alert(data);
$("#fileExplorer").data("ejFileExplorer").option("selectedFolder", result);
}
});
}
function onclick() {
$("#basicDialog").ejDialog("open");
getCustomer();
$("#btnOpen").hide();
}
|