We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Add UploadBox on Grid event, edit mode - batch.

Thread ID:

Created:

Updated:

Platform:

Replies:

132762 Sep 19,2017 03:00 PM Sep 23,2017 12:20 AM JavaScript 3
loading
Tags: ejGrid
noName
Asked On September 19, 2017 03:44 PM

I have edit template in Grid for 1 of the columns - div with id '#upload'

I am using edit mode batch and when I click on the cell, I see the template. For adding UploadBox I am using cellEdit event, which is only the event happen:
cellEdit: function (args) {
 $('#upload').ejUploadbox({
                            saveUrl: "/home/upload",
                            showFileDetails: false,
                            extensionsAllow: ".jpg, .jpeg",
                            fileSelect: function (args) {
 },
, but in this way it doesn't work. If I change mode to inline and event to :
actionComplete: function (args) {
 $('#upload').ejUploadbox({
                            saveUrl: "/home/upload",
                            showFileDetails: false,
                            extensionsAllow: ".jpg, .jpeg",
                            fileSelect: function (args) {
 },
it works fine, but not with edit mode batch and cellEdit event.
Is there way to add UploadBox in edit mode - batch ?

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On September 20, 2017 11:59 AM

Hi Customer, 

We have checked your query and if you want to place the upload box into the Grid while on batch editing, you can use column Template support of the Grid. In the column template we have placed the upload box as the template column. In the templateRefresh event of the Grid, you can render the upload box in any of the Grid column. If you want to perform operations such as filtering/Sorting/ Grouping for template column, you need to define the “type” of the particular column data. In Grid, these operations are performed based on the field name, so we suggest you to set the field and type property to perform sorting, filtering and  Grouping operation in Grid.  
  
Please refer to the documentation link:- 



Please refer to the code example:- 

       <script type="text/x-jsrender" id="columnTemplate"> 
             <div id="upload" class="upload"></div> 
        </script>     
      <script type="text/javascript"> 
        $(function () { 
            $("#Grid").ejGrid({ 
                 
                columns: [ 
                         { field: "EmployeeID", headerText: "UploadBox", template: true, templateID: "#columnTemplate", textAlign: "center", width: 110 }, 
                         { field: "EmployeeID", headerText: "Employee ID", isPrimarykey: true, editType: ej.Grid.EditingType.NumericEdit, textAlign: ej.TextAlign.Right, width: 90 }, 
                         { field: "FirstName", headerText: "First Name", width: 90 }, 
                         . . . 
                ], 
                templateRefresh: "template", 
            }); 
        }); 
 
        function template(args) { 
            $(args.cell).find(".upload").ejUploadbox({ saveUrl: "" }); 
 
        } 
    </script> 


Please refer to the sample:- 


Online Demo Link:-  


Please get back to us if you need any further assistance. 

Regards, 

Farveen sulthana T 



noName
Replied On September 21, 2017 12:26 PM

Is there way to show button only if cell is clicked ?  cellEdit, doesn't work to bind uploadBox.

When I click on cell and it is active, the button is removed and there is input tag, instead, how to prevent that ?

I am using  template. On click to be same template, but not input tag.


Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On September 23, 2017 12:20 AM

Hi Customer, 

If you want to perform click action on button which was placed on the template column, you shouldn’t mention the field property for that template column. Because Grid operations has been performed based on field property of the Grid. So we suggest you to remove field property of the Grid for template column. 

Please refer to the sample:- 


Please get back to us if you need any further assistance. 

Regards, 

Farveen sulthana T 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;