Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
15
ignite-ui-angular/angular/components/grid/search
posted

I am having a problem with the search engine. It is not highlighting the columns that ng-template. I need to use ng-template to use the let-cell to manipulate the information and style.

        <igx-column *ngIf="row.datatype === 'capitalized'" [field]="row.value" [header]="row.header"
            [pinned]="row.pinned" [hidden]="row.hidden" [sortable]="varTrue" [headerGroupStyles]="alignCenterHeader"
            [dataType]="'string'" [cellStyles]="animatedCenter" [resizable]="true" [width]="adjustable ? 'auto' : ''">
            <ng-template igxCell let-cell="cell" let-val let-row>
                <p *ngIf="val" style="text-align: center;">{{val | underscoreToSpace | titlecase }}</p>
            </ng-template>
        </igx-column>
I need the search engine to highlight the search even if I use ng-template to modify formatting
Parents
No Data
Reply
  • 2680
    Offline posted

    Hi Sebastian,

    Thank you for contacting Infragistics Developer Support!

    According to the Grid Searching topic section about known limitations, I am afraid that searching in cells with a template is listed as such.

    Looking at the snippet's cell template, however, as it is fairly simple, I can suggest programmatically transforming the value and applying any styles, such as the text-align via the cellStyles property of the column. By transforming the value in code, I mean creating a new field in the data source that would be used simply for display purposes. Assuming from the names of the custom pipes, the transformations seem to be altering an underscore character to space and setting the string in upper case. For the former, the custom pipe's transform method could be used in the code as well.

    Here is a small sample I prepared to demonstrate this suggestion.

    If you require any further assistance on the matter, please let me know.

    Best regards,
    Bozhidara Pachilova
    Associate Software Developer

Children
No Data