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

I want to generate all rows , all cells with unique ids of gridview

Technology must be angular js and mvc

 <div  id="targetsGrid" ej-grid e-datasource="data"
                   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"
                   >
                </div>

   $scope.setTargetList = function (targetList) {
            $scope.data = targetList

        }


  I am sending some portion of code for your better understanding.

  I want to generate all rows , all cells with unique ids
Waiting for your quick reply.



1 Reply

BM Balaji Marimuthu Syncfusion Team September 17, 2015 11:14 AM UTC

Hi Rakesh,

Thank you for contacting Syncfusion support.

Query:  I want to generate all rows , all cells with unique ids
If you want to generate the cells (td) with unique ids, use the customAttributes in the Grid columns. By using this property you can modify the styles and appearance of a particular column.

Please refer to the sample and help document in the following link:
Sample: sample120271
Document: http://help.syncfusion.com/js/grid/columns#custom-attribute
http://help.syncfusion.com/js/api/ejgrid#members:columns-customattributes

angular.module('listCtrl', ['ejangular'])

        .controller("PhoneListCtrl", function ($scope) {

            $scope.columns =  [

                          { field: "EmployeeID", headerText: 'Employee ID', textAlign: ej.TextAlign.Right, width: 75 },

                          { field: "FirstName", headerText: 'First Name', textAlign: ej.TextAlign.Left, width: 100 },

                          { field: "City", headerText: 'City', textAlign: ej.TextAlign.Left, width: 100,customAttributes: { "id": "{{:EmployeeID}}" } },  // jsrender syntax usage in custom Attribute


                           . . . .

            ]

            $scope.groupedcol = ["EmployeeID"];


            $scope.onLoadClick = function () {

                var data = window.employeeView;

                var targetsGrid = $("#targetsGrid").data("ejGrid");

                $scope.data = data;

            }

           
        });



Before proceeding further, could you please share the following details?
1.       Are you want to generate unique id’s to all rows (tr) and all cells (td)?
2.       Share the requirement to generate all rows and cells with unique ids.
3.       Please explain more details about how you want the unique ids which will be helpful to analyze your requirement and provide the better solution at the earliest.



Regards,
Balaji Marimuthu


Loader.
Live Chat Icon For mobile
Up arrow icon