1

I am using the new AngularJS ui-grid in my application. I want to create an anchor that has parameters taken from other fields in the grid as part of the href attribute ie:

<a href="/BridgeAssess/nhvrRoute/routeAssessor?routeNo={{COL_FIELD CUSTOM_FILTERS}}&journeysId={{grid.routeNo}}&routeVersion={{grid.routeVersion}}" class="create" target="_blank">{{COL_FIELD CUSTOM_FILTERS}}</a>

This code is stored in an template html file and added to the columDefs object:

        $scope.gridOptions = {
        enableSorting: false,
        enableColumnResizing: true,
        columnDefs: [
            {field:'link', width: '120'},
            {field:'routeNo', cellTemplate:'templates/cellTemplate.html', width: '120'},
            {field:'routeFrom', displayName:'From', width: '450'},
            {field:'routeTo', displayName: 'To', width: '450'},
            {field:'routeVersion', displayName:'Version', width: '90'},
            {field:'journey', visible: false}
        ]
    };

This code creates the link but the only parameter set is routeNo.

I can't see how to set the other parameters. gridOptions.data[rowNum].journey, for example, does not add a value.

How can I get values for the other parameters?

1 Answer 1

3

use row.entity.xxx in your template.

<div>
 <a href="test.html?code={{row.entity.code}}&name={{row.entity.name}}&status={{row.entity.status}}">
  Click me
 </a>
</div>

Here is a Plunker with more details.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.