BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Sorry,
Version ASP.net MVC (NO-CLASSIC) ....
Hi Jesus,
Based on your request, we have created a custom sample in MVC Grid control which performs CRUD operation with photo field column and the same can be downloaded from the below location.
Sample Location: CRUD_in_Employees_Images.zip
In the above sample, the grid is populated with the data from the Web API 2 Controller and we have used column template to display employee image and used inlineformtemplate editing to perform CRUD operation in grid. The employee image name will be retrieved from the server.
The column template and the inlineformtemplate used in the above sample are as follows.
<!--Column Template--> <script id="imagetemplate" type="text/x-jsrender"> <img style="width: 150px; height: 130px" src="../ejThemes/Employees/{{:PhotoPath}}" /> </script>
<!--InlineFormEdit Template--> <script id="editTemp" type="text/x-jsrender"> <table> <tr> <td>EmployeeID</td> <td style="text-align: left"> <input id="EmployeeID" name="EmployeeID" value="{{: EmployeeID}}" disabled="disabled" class="e-field e-disable e-ejinputtext valid" style="text-align: right; width: 116px; height: 28px" /> </td> </tr> <tr> <td>Upload Photo</td> <td><input id="PhotoPath" name="PhotoPath" value="{{: PhotoPath}}" class="e-field e-disable e-ejinputtext valid" style="text-align: right; width: 116px; height: 28px" /></td> <td><span id="upload"></span></td> <!—UploadBox for Uploading photo--> </tr> </table> </script>
|
In the edit actionBegin event, we have rendered the uploadbox control as follows.
function editBegin(args) { //actionBegin Event if (args.requestType == "beginedit" || args.requestType == "add") {
$("#upload").ejUploadbox({ //Rendering the uploadbox control browseButtonText: "Browse", saveUrl: "/Home/Save", fileFormatAllow: ".png", });
var uploadObj = $("#upload").data("ejUploadbox"); $("#InlineEditForm_Grid_Save").click(function (e) { uploadObj._xhrOnUploadButtonClick(e); //Binding the upload event to inlineformedit template button });
} }
|
The above sample has following issue:
• While adding new record, the added record would not be reflected immediately in Grid until Grid refresh (or pagination). After grid is refreshed the newly added record is displayed in the corresponding page.
We have already logged “Update and Add New Record issue in CRUD operation” as defect and the fix for this issue will be estimated to available in our upcoming Volume 2, 2014 release.
Please let us know if you have any queries.
Regards,
Madhu Sudhanan. P
Hi Jesus,
Sorry for the inconvenience caused.
We afraid that we are unable to reproduce the reported issue and could you provide us more information regarding the issue?. The information provided would be more information for us to analyze the issue and provide you the solution as early as possible.
And the solution we have provided in the last update, is the best method to use the UploadBox control for CRUD operation in grid.
Please let us know if you have any queries.
Regards,
Madhu Sudhanan. P
Hi Jesus
Thanks for the update.
Yes. The fix for the issue “Update and Add New Record
issue in CRUD operation” is estimated to be included in our Volume
2, 2014 release. We will get back to you once our Volume 2, 2014 is rolled out.
Please let us know if you need any further assistance.
Regards
Ragavee U S