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. Image for the cookie policy date

I want to save whole grid data with dropdown.but not able to access dropdown data while click on external save button

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

1 Reply

RU Ragavee U S Syncfusion Team September 25, 2015 12:08 PM UTC

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

Loader.
Up arrow icon