Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kendo UI Angular - How to display a regular hyperlink (underlined and blue) in grid?

I want to display hyperlinks within a grid of Kendo UI for Angular. Sometimes the simplest of things are the hardest to do...

Here is my column:

<kendo-grid-column field="number" title="Number">
    <ng-template kendoGridCellTemplate let-dataItem let-rowIndex="rowIndex">
        <a href='{{azureStorageBaseUrl}}/invoices/{{dataItem.number}}.pdf' target="_blank">{{dataItem.number}}</a>
      </ng-template>
</kendo-grid-column>

I'd like the 'number' to be blue and underlined as a regular hyperlink but it's just black and not underlined.

like image 483
François Avatar asked Nov 07 '17 13:11

François


2 Answers

            <kendo-grid-column field='Number' title='Number' width='120'>
                <ng-template kendoGridCellTemplate let-dataItem >
                  <a href="javascript:void(0)" (click)="clickEvent(dataItem.number)">{{dataItem.number}}</a>
                </ng-template>
              </kendo-grid-column>

Just style it and add either a link or a custom click event as shown above.

like image 79
CodeMan03 Avatar answered Nov 06 '22 06:11

CodeMan03


this worked for me :

<kendo-grid-command-column width="550">
    <ng-template kendoGridCellTemplate let-dataItem="dataItem">
        <a style="color: blue" href="https://www.w3schools.com/html/">{{dataItem.number}}</a>
    </ng-template>
</kendo-grid-command-column>

i guess you need "kendo-grid-command-column" instead of "kendo-grid-column"

like image 2
FilipYordanov Avatar answered Nov 06 '22 07:11

FilipYordanov