Column template generating an error

Hi,

I try to use the column template in ejs-grid (using v. 16.1.24) as described here :

https://ej2.syncfusion.com/16.1.24/angular/demos/#/material/grid/columntemplate
https://ej2.syncfusion.com/16.1.24/angular/documentation/grid/how-to.html#render-other-components-in-a-column

However it fail with a TypeError: str.replace is not a function within a simple grid, linked to an odatavb4 adaptor and a template even without bindings.

<ejs-grid #grid [dataSource]="data"
    <e-column headerText="Description" width='200'>
        <ng-template #template let-data>
            <div>test</div>
        </ng-template>
        </e-column>
    </e-columns>
</ejs-grid>

Based on the demo and documentation, i can't find where i'm wrong.

Stack:

evalExp@https://127.0.0.1:9008/dist/main-client.js?v=dD5mLQUWcCaBfGHw0IahGRuAepZe1fLkGTashKytbbc:214970:12
compile$1@https://127.0.0.1:9008/dist/main-client.js?v=dD5mLQUWcCaBfGHw0IahGRuAepZe1fLkGTashKytbbc:214958:25
Engine.prototype.compile@https://127.0.0.1:9008/dist/main-client.js?v=dD5mLQUWcCaBfGHw0IahGRuAepZe1fLkGTashKytbbc:215073:16
compile$$1@https://127.0.0.1:9008/dist/main-client.js?v=dD5mLQUWcCaBfGHw0IahGRuAepZe1fLkGTashKytbbc:215038:20
templateCompiler@https://127.0.0.1:9008/dist/main-client.js?v=dD5mLQUWcCaBfGHw0IahGRuAepZe1fLkGTashKytbbc:76860:20
Column@https://127.0.0.1:9008/dist/main-client.js?v=dD5mLQUWcCaBfGHw0IahGRuAepZe1fLkGTashKytbbc:76707:31
prepareColumns@https://127.0.0.1:9008/dist/main-client.js?v=dD5mLQUWcCaBfGHw0IahGRuAepZe1fLkGTashKytbbc:76900:26
Grid.prototype.render@https://127.0.0.1:9008/dist/main-client.js?v=dD5mLQUWcCaBfGHw0IahGRuAepZe1fLkGTashKytbbc:85973:9
Component.prototype.appendTo@https://127.0.0.1:9008/dist/main-client.js?v=dD5mLQUWcCaBfGHw0IahGRuAepZe1fLkGTashKytbbc:213181:13
__WEBPACK_AMD_DEFINE_RESULT__</ComponentBase.prototype.ngAfterViewInit/<@https://127.0.0.1:9008/dist/main-client.js?v=dD5mLQUWcCaBfGHw0IahGRuAepZe1fLkGTashKytbbc:318551:21

Thanks for your help !

1 Reply

DR Dhivya Rajendran Syncfusion Team March 22, 2018 01:09 PM UTC

Hi Jean, 
Thanks for contacting Syncfusion support, 
We have validated your query “Column template generating an error” ”, it was working fine at our end. We have created a sample as per your requirement. Kindly please refer to the below sample and code snippet for more information. 
<div class="control-section"> 
    <ejs-grid #grid [dataSource]='data'> 
        <e-columns> 
            <e-column headerText='Description' width='200'> 
                <ng-template #template let-data> 
                    <div>test</div> 
                </ng-template> 
            </e-column> 
             . . . . . . . 
            <e-column field='FirstName' headerText='Name' width='120'></e-column> 
        </e-columns> 
    </ejs-grid> 
</div> 

 

If we misunderstood your query, could you please provide a sample or more information regarding your query , it will be more helpful for us to provide a better solution as soon as possible. 
Regards,
R.Dhivya 


Loader.
Up arrow icon