How to access grid ui row data in extensible row template?

I am trying to implement an extensible ui grid with a custom extensible template. How can I access string data in a template?

In the controller, I have defined the grid parameters as follows:

            scope.GridOptions =
            {
                data: customers,
                columnDefs:
                [
                    { name: "FirstName", field: "FirstName", width: 130 },
                    { name: "LastName", field: "LastName", width: 130 }
                ],
                expandableRowTemplate: 'CustomerDetails.html',
                expandableRowHeight: 150
            };

      

and the template looks like this:

<div class="row">
    <div class="col-md-2">
        {{FirstName}} {{LastName}}
    </div>
</div>

      

Thank!

+3


source to share


1 answer


I found the answer. To access the row data, I need to use row.entity in the template.



<div class="row">
    <div class="col-md-2">
        {{row.entity.FirstName}} {{row.entity.LastName}}
    </div>
</div>

      

+5


source







All Articles