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 whole grid data with dropdown.but not able to access dropdown data while click on external save button

Thread ID:

Created:

Updated:

Platform:

Replies:

120537 Sep 24,2015 08:10 AM Sep 25,2015 08:08 AM JavaScript 1
loading
Tags: ejGrid
Bharat Buddhadev
Asked On September 24, 2015 08:10 AM

plz referef image
Tehcnolgy must be angular js and mvc

step1 selected dropdvalue
click on save
In my grid view many columns with dropdown
but
When I click on external Save button of my page I want to access whole datasource of gridview and save .
but
Issue : In datasource of gridview selected dropdown values is not coming instead always first record of dropdown is always coming.
$scope.saveTargets = function()
{
var objCmis = $("#targetsGrid").data("ejGrid");
var griddata=objCmis.model.dataSource();
console.log(griddata)

}
If i observer the console data dropdown selected values is not coming.



e-columns="columns"
class="gridStyle"
e-allowresizing="true"
e-allowkeyboardnavigation="true"
e-allowscrolling="true"
e-allowsorting="true"
e-minwidth="550"
e-isresponsive="true"
e-scrollsettings-height="320"
e-allowgrouping="true"
e-groupsettings-groupedcolumns="targetGroupColumn"
e-allowfiltering="true"
e-filtersettings-filtertype="excel"
e-actioncomplete="complete"
e-create="complete"
>
$scope.complete = function (args) {
if (!this.initialRender) {
$scope.compile($(".drpAccessGroup"))
}
};
angular.module("administrationModule")
.controller("targetsController", ["$scope", "$http", "securityService", "$filter", "$compile", "$rootScope", function ($scope, $http, securityService, $filter, $compile, $rootScope) {
$scope.status = { open: true };
var refreshAction = "refresh";
$rootScope.data = null;
$scope.accessGroupData = null;
$scope.maximumGridHeight;
var maximumRowNumbers = 4;
$scope.columns = [
{ field: "targetNumber", headerText: administrationSecurityResources.targetNumber, width: 100 },
{ field: "targetType", headerText: administrationSecurityResources.targetType, width: 100 },
{ field: "targetName", headerText: administrationSecurityResources.targetName, width: 100 },
{ field: "targetDescription", headerText: administrationSecurityResources.description, width: 100 },
{ field: "accessGroupMarking", headerText: administrationSecurityResources.accessGroup, template: "true", templateID: "#accessGroupTemplate", width: 120 },
];
$scope.targetGroupColumn = ["targetType"];
$scope.compile = function (el) {
$compile(el)($scope);
}
$scope.complete = function (args) {
if (!this.initialRender) {
$scope.compile($(".drpAccessGroup"))
}
};
$scope.setTargetList = function (targetList) {
$rootScope.data = targetList;
$rootScope.data = $filter('orderBy')($scope.data, 'targetName');
$scope.getListofAccessGroup();
//console.log($scope.data)
}
$scope.getListofAccessGroup = function () {
securityService.getAccessGroupsList()
.then(function (accessGroupData) {
$scope.accessGroupData = $filter('orderBy')(accessGroupData, 'markingString');;
//$scope.accessGroupData.splice(0, 0, { markingString: "<Unrestricted>" });
}).catch(function (error) {
});
};
}]);

Attachment: dropdown_4b30d6b5.rar

Ragavee U S [Syncfusion]
Replied On September 25, 2015 08:08 AM

Hi Bharat,

We analyzed your requirement and the code snippets, screenshots that you have shared.

The template column and the grid dataSource are independent to each other. The template column values are not maintained in the grid dataSource. Thus changing the value in the template column wont affect the grid dataSource.

So with respect to your requirement, we suggest you to get the value of the dropdown manually by traversing to the corresponding row and get the selected value of the dropdown using the getSelectedValue method of the ejDropDownList.

Regards,
Ragavee U S

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.

;