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
close icon

one dropdown change of grid it automatically change all the dropdown of grid


Its very urgent. to complete current work.
waiting for your very very quick reply

1) when we change one dropdown other dropdown automatically changed
2) when we rebind the dropdown of grid we are not able to set selected value.


<div ma-target-grid-sorting id="targetsGrid" ej-grid e-datasource="data" ng-init="setTargetList(@Newtonsoft.Json.JsonConvert.SerializeObject(@Model, new Newtonsoft.Json.JsonSerializerSettings { ContractResolver = new Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver() }))"
                     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"
                     e-enabletouch="false">
                </div>

 $scope.setTargetList = function (targetList) {


            $rootScope.data = targetList.targetViewModelList;
            $rootScope.data = $filter('orderBy')($rootScope.data, 'targetName');

            $rootScope.accessGroupData = $filter('orderBy')(targetList.accessGroupMarkingViewModelList, 'markingString');
            $rootScope.accessGroupData.splice(0, 0, { markingString: "Unrestricted" });

        }



  $scope.setTargetAccessGroup = function (args) {
            $filter('filter')($rootScope.data, function (selectedRecord) {
                if (selectedRecord.targetName === args.model.fields.id) {
                    selectedRecord.accessGroupMarking = args.value;
                    selectedRecord.accessGroupMarkingId = args.model.dataSource[args.itemId].markingId;
                }
            });

        };



3 Replies

BM Balaji Marimuthu Syncfusion Team October 2, 2015 02:33 PM UTC

Hi Rakesh,

Thanks for contacting Syncfusion support.

We have created a sample and checked the reported issue. Please refer to the sample in following link

Sample: http://jsplayground.syncfusion.com/5ouyoqp3

We have used the provided code and changed the dropdown data, but we are unable to reproduce the reported issue. Could you please share the following details to reproduce the reported issues from our end?

1.       Are you rendering one template column with drop down?
2.       Share the code example of how you dynamically generate the dropdown
3.       How do you set selected value to dropdown?
4.       Share how you rebind the dropdown data
5.       Share full sample/ modify the provided jsplayground sample

If we misunderstood your requirement, share the scenario to reproduce the issue.

Regards,
Balaji Marimuthu




RA Rakesh Advani October 5, 2015 09:03 AM UTC

Hello,

I am glad to hear from you. i need one more help. i want to access that all dropdown which is inside the grid. is there any way for access that all dropdown list?


Sample: http://jsplayground.syncfusion.com/5ouyoqp3

Actually i want to refresh that all dropdown and make default record selected as datasource changes.

Thanks,
Rakesh



BM Balaji Marimuthu Syncfusion Team October 6, 2015 07:36 AM UTC

Hi Rakesh,

We have achieved your requirement in button click. You can access all dropdownlist inside the grid by using the dropdownlist class name e-dropdownlist. Refer the code example and sample as follows,
http://jsplayground.syncfusion.com/gkrk3c4p



$scope.click = function (args) {

                  var gridobj = $('#targetsGrid').ejGrid("instance");

                  ddl = gridobj.getContent().find('.e-dropdownlist');  //accesss dropdown by using the class

                  for (i = 0; i < ddl.length; i++)

                       $(ddl[i]).ejDropDownList('setSelectedValue', 'Country3');  //set value to dropdownlist
              }


To set the selectedValue to dropdown by using the setSelectedValue property. Refer to the help document:

http://help.syncfusion.com/js/api/ejdropdownlist#methods:setselectedvalue


Regards,
Balaji Marimuthu

Loader.
Live Chat Icon For mobile
Up arrow icon