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 generate column and rows with unique ids

Technology must be angularjs and mvc

 I have three columns in my grid

like a, b , c 

Now I want to assign unique id to each row of column b.

So as a result all  td  of particular column should have unique id.


At column I want to generate unique id of grid cells





1 Reply

BM Balaji Marimuthu Syncfusion Team September 17, 2015 10:41 AM UTC

Hi Bharat,

Thank you for contacting Syncfusion support.

Your requirement can be achieved by using the customAttributes property in the Grid columns. By using this property you can modify the styles and appearance of a particular column.
Please refer to the following sample and code example:
Sample: angularsupport

  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

                          { field: "Title", headerText: 'Title', textAlign: ej.TextAlign.Left, width: 120 },

                          { field: "Country", headerText: 'Country', textAlign: ej.TextAlign.Left, width: 100 }

            ]


            $scope.onLoadClick = function () {

                var data = window.employeeView;

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

                $scope.data = data;

            }

           
        });


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


Regards,
Balaji Marimuthu

Loader.
Live Chat Icon For mobile
Up arrow icon