BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
@(Html.EJMobile().Grid<FileManagerMobileVM>("gridFileManagerMobile") .Datasource(d => d.Adaptor(AdaptorType.JsonAdaptor)) .Columns(c => { c.Field("Name").HeaderText("Nombre").Add(); c.Field("Path").Visible(false).Add(); c.Field("Button").HeaderText("Enlace").Add(); }) .ClientSideEvents(c => c.Load("createGridFileManager")) .AllowSelection(false) .AllowScrolling(false) ) |
function successGridFileManager(data) { var dataJson = []; if (data != null && data != undefined) { $.each(data, function (s, e) { var name = e.name; var type = e.type; var path = "@Model.FilesPath"; var fullpath = path + name; var nuevo = { Name: name, Path: path, Button: '<div class="e-m-btnwrapper e-m-ios7 e-m-light e-m-btn-normal e-m-state-default"><input onclick="descargarAttachment(\'' + fullpath + '\',\'' + name + '\')" data-ej-text="Descargar" data-role="ejmbutton" id="button" type="button" class="e-m-btn e-js e-m-clearall e-m-btn-tag e-m-font-normal e-m-state-default e-m-user-select" tabindex="" name="button" value="Descargar"></div>' } dataJson.push(nuevo); }) var jsonFormat = ej.parseJSON(dataJson); var obj = $("#gridFileManagerMobile").ejmGrid("instance"); obj.model.dataSource.dataSource.json = jsonFormat; obj.refreshContent(); } } function descargarAttachment(path, name) { var fullpath = "/Operacion/DownloadFile?path=" + path + "&name=" + name; location.rel='nofollow' href = fullpath; } |
Hi David,
Thanks for using Syncfusion products.
Please confirm the following details.
1. You have mentioned that datasource is set by JS. But in the code, that you have used load event with function name createGridFileManager but used successGridFileManager
2. Are you rendering the Button in any one of the columns?
3. Share us your Essential Studio version details.
4. Provide a sample for us if possible.
Please get back to us with the mentioned details, we will be happy to assist you.
Regards,
Prasanna Kumar N.S.V
Hi David,
Thanks for using Syncfusion products.
Please confirm the following details.
1. You have mentioned that datasource is set by JS. But in the code, that you have used load event with function name createGridFileManager but used successGridFileManager
2. Are you rendering the Button in any one of the columns?
3. Share us your Essential Studio version details.
4. Provide a sample for us if possible.
Please get back to us with the mentioned details, we will be happy to assist you.
Regards,
Prasanna Kumar N.S.V
1. You have mentioned that datasource is set by JS. But in the code, that you have used load event with function name createGridFileManager but used successGridFileManager | function refreshGridFiles() { var data = { ActionType: "Read", Name: "", Path: "@Model.FilesPath", ExtensionsAllow: "*.*" }; $.post("/Operacion/FileActionDefault", data, successGridFileManager) } function createGridFileManager(args) { refreshGridFiles(); } function successGridFileManager(data) { var dataJson = []; if (data != null && data != undefined) { $.each(data, function (s, e) { var name = e.name; var type = e.type; var path = "@Model.FilesPath"; var fullpath = path + name; var nuevo = { Name: name, Path: path, Button: '<div class="e-m-btnwrapper e-m-ios7 e-m-light e-m-btn-normal e-m-state-default"><input onclick="descargarAttachment(\'' + fullpath + '\',\'' + name + '\')" data-ej-text="Descargar" data-role="ejmbutton" id="button" type="button" class="e-m-btn e-js e-m-clearall e-m-btn-tag e-m-font-normal e-m-state-default e-m-user-select" tabindex="" name="button" value="Descargar"></div>' } dataJson.push(nuevo); }) var jsonFormat = ej.parseJSON(dataJson); var obj = $("#gridFileManagerMobile").ejmGrid("instance"); obj.model.dataSource.dataSource.json = jsonFormat; obj.refreshContent(); } } |
Are you rendering the Button in any one of the columns? | Only add button... Button: '<div class="e-m-btnwrapper e-m-ios7 e-m-light e-m-btn-normal e-m-state-default"><input onclick="descargarAttachment(\'' + fullpath + '\',\'' + name + '\')" data-ej-text="Descargar" data-role="ejmbutton" id="button" type="button" class="e-m-btn e-js e-m-clearall e-m-btn-tag e-m-font-normal e-m-state-default e-m-user-select" tabindex="" name="button" value="Descargar"></div>' } |
Share us your Essential Studio version details. | <add assembly="Syncfusion.EJ, Version=13.2450.0.29, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" /> <add assembly="Syncfusion.EJ.MVC, Version=13.2500.0.29, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89" /> |
Provide a sample for us if possible. | @using (Html.BeginForm("SaveMobile", "Operacion", FormMethod.Post, new { id = "formOperacionMobile" })) { @Html.HiddenFor(m => m.Id) @Html.HiddenFor(m => m.EstadoId) @Html.HiddenFor(m => m.Parado) <br /> <div class="content-form-mobile"> <div> @(Html.EJMobile().Grid<FileManagerMobileVM>("gridFileManagerMobile") .Datasource(d => d.Adaptor(AdaptorType.JsonAdaptor)) .Columns(c => { c.Field("Name").HeaderText("Nombre").Add(); c.Field("Path").Visible(false).Add(); c.Field("Button").HeaderText("Enlace").Add(); }) .ClientSideEvents(c => c.Load("createGridFileManager")) .AllowSelection(false) .AllowScrolling(false) ) <div style="margin-top:10px"> @(Html.EJMobile().Button("btnUploadFile") .Text("Subir foto") .RenderMode(RenderMode.Auto) .ClientSideEvents(c => c.TouchEnd("touchEndUploadFile"))) <div id="errorUploadFile" style="display:none" class="alert alert-danger" role="alert"> </div> </div> </div> <br /> </div> } <script> function touchEndUploadFile() { $("#inputFile").click(); } function uploadFile() { var inputfile = document.getElementById('inputFile'); if (!ej.isNullOrUndefined(inputfile)) { if (inputfile.files[0] != null) { $('#formUploadFile').submit(); } } } function refreshGridFiles() { var data = { ActionType: "Read", Name: "", Path: "@Model.FilesPath", ExtensionsAllow: "*.*" }; $.post("/Operacion/FileActionDefault", data, successGridFileManager) } function createGridFileManager(args) { refreshGridFiles(); } function successGridFileManager(data) { var dataJson = []; if (data != null && data != undefined) { $.each(data, function (s, e) { var name = e.name; var type = e.type; var path = "@Model.FilesPath"; var fullpath = path + name; var nuevo = { Name: name, Path: path, Button: '<div class="e-m-btnwrapper e-m-ios7 e-m-light e-m-btn-normal e-m-state-default"><input onclick="descargarAttachment(\'' + fullpath + '\',\'' + name + '\')" data-ej-text="Descargar" data-role="ejmbutton" id="button" type="button" class="e-m-btn e-js e-m-clearall e-m-btn-tag e-m-font-normal e-m-state-default e-m-user-select" tabindex="" name="button" value="Descargar"></div>' } dataJson.push(nuevo); }) var jsonFormat = ej.parseJSON(dataJson); var obj = $("#gridFileManagerMobile").ejmGrid("instance"); obj.model.dataSource.dataSource.json = jsonFormat; obj.refreshContent(); } } function descargarAttachment(path, name) { var fullpath = "/Operacion/DownloadFile?path=" + path + "&name=" + name; // window.open(fullpath); location.rel='nofollow' href = fullpath; } function confirmAlert(args) { App.activePage.find("#dialogAlertMobile").ejmDialog("close"); } function confirmModal(args) { if (args.text == "No") { $("#Parado").val("false") } else if (args.text == "Sí") { $("#Parado").val("true") } $("#EstadoId").val("@((int)EnumsHelper.EstadoOperacion.Finalizada)") $("#formOperacionMobile").submit(); } function touchEndToolbar(args) { if (args.itemname == "save") { $("#formOperacionMobile").submit(); } if (args.itemname == "done") { var instanceTrabajoRealizado = App.activePage.find("#TrabajoRealizado").ejmTextArea("instance"); //Trabajo realizado vacio. if (instanceTrabajoRealizado.getValue() == "") { App.activePage.find("#dialogAlertMobile").ejmDialog("open"); } else { App.activePage.find("#dialogConfirmMobile").ejmDialog("open"); } } if (args.itemname == "back") { location.rel='nofollow' href = "/Dashboard/IndexMobile"; } } </script> |
Please let us know if we have missed anything.
Regards,
Prasanna Kumar N.S.V