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.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

120665 Oct 1,2015 07:30 AM Oct 6,2015 03:36 AM JavaScript 3
loading
Tags: ejGrid
Rakesh Advani
Asked On October 1, 2015 07:30 AM


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;
                }
            });

        };



Balaji Marimuthu [Syncfusion]
Replied On October 2, 2015 10:33 AM

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



Rakesh Advani
Replied On October 5, 2015 05:03 AM

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


Balaji Marimuthu [Syncfusion]
Replied On October 6, 2015 03:36 AM

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

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.

;