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.

I want to save grid dropdown data.

Thread ID:

Created:

Updated:

Platform:

Replies:

120278 Sep 17,2015 01:00 AM Sep 21,2015 03:16 AM JavaScript 3
loading
Tags: ejGrid
Rakesh Advani
Asked On September 17, 2015 01:00 AM

Technology must be angular js and mvc

I have two column of the grid 
1)textbox  (user will fill data)
2)dropdown should have data so use can select from dropdown



when I click on save button of the grid I want save both textbox and dropdown data.
So basically I want to access both dropdown and textbox data in grid ActionComplete




Waiting for your quick reply.



Balaji Marimuthu [Syncfusion]
Replied On September 18, 2015 03:26 AM

Hi Rakesh,
Thanks for contacting Syncfusion support.
Your requirement can be achieved by enabling the editType property in Grid columns. Please refer to the sample and code example below.
Sample: Sample120278





$scope.columns = [

                          { field: "EmployeeID", headerText: 'Employee ID', isPrimaryKey: true, textAlign: ej.TextAlign.Right, width: 115 }, //enable isPrimaryKey property to edit the rows

                          { field: "FirstName", headerText: 'First Name', textAlign: ej.TextAlign.Left, width: 150, editType: ej.Grid.EditingType.Dropdown },


            ]




Please refer to the help document in following link:
Document: http://help.syncfusion.com/js/api/ejgrid#members:columns-edittype


In actionComplete event, you can access both the dropdown and textbox data when requestType is save by using the args.data which return the record object.
Please refer to the help document in following link:
http://help.syncfusion.com/js/api/ejgrid#events:actioncomplete


<div id="targetsGrid" ej-grid e-datasource="data"

                     e-columns="columns"

                     e-actioncomplete="actioncomplete"

                     e-editsettings="edit"

                     e-toolbarsettings="tool"

                   ></div>



$scope.actioncomplete = function (args) {

                if(args.requestType == "save")

                    alert("EmployeeID: " + args.data["EmployeeID"] + " FirstName: " + args.data["FirstName"])

            }


Regards,
Balaji Marimuthu

Bharat Buddhadev
Replied On September 18, 2015 05:51 AM

Thanks for your last solution but I do not want to use in editmode

Here first I have to click on cell after that dropdown appears in editmode
but I want to use dropdown without click and row and make it editable.



So here my requirement is like once grid bind is done I should have access to use dropdown
 instead first click on row and then use it.

Balaji Marimuthu [Syncfusion]
Replied On September 21, 2015 03:16 AM

Hi Rakesh, 

We are sorry that we are unable to understand your requirement clearly. So please share the following details,
 


1.       When do you want to save the dropdown data to Grid?

2.       Are you using any adaptor (Url Adaptor, Remote save, WebApi Adaptor) in Grid? 

3.       To render the Grid with dropdown data and access without Edit option, use Column template in Grid. But the template column will refresh at every Grid Action. So Editing will not supported for template columns. Please refer the following Demo, 


http://js.syncfusion.com/demos/web/#!/azure/grid/columns/columntemplate


4. To use an Edit option at single click, use the Batch Editing in Grid and refer to the online demo link, 


http://js.syncfusion.com/demos/web/#!/azure/grid/Editing/BatchEditing


You can also use the command columns in Grid and refer to the following link, 


http://js.syncfusion.com/demos/web/#!/azure/grid/editing/commandcolumn


Please refer to the above provided links. If your requirement is different, please share more details which will be helpful to analyze the requirement and provide better solution at the earliest.

Regards, 
Balaji Marimuthu


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.

;