WjFlexGridCellTemplate no cell var

Posted by: patrick-rueckert on 14 September 2017, 11:37 am EST

    • Post Options:
    • Link

    Posted 14 September 2017, 11:37 am EST

    Hi, I’m trying to follow your cell template example to get Buttons to custom column.

    Sadly I cant get any further because I end up with an error. (see below)

    It seems template dont have the variables item, cell, row defined.

    Any Idea? Do I miss smth? I’m out of ideas.

    TS

    
    @Component({
        selector: 'ressources',
        templateUrl: 'app/modules/ressource/ressources.component.html',
        directives: [CORE_DIRECTIVES, BaseGrid, GridSearchBox, CustomGrid,
                    wjGrid.WjFlexGrid, wjGrid.WjFlexGridColumn, wjGrid.WjFlexGridCellTemplate, wjGrid.WjTemplateCmp,
                    wjCore.WjComponentLoader,
                    EditableSelectionRenderer, EditableButtonRenderer, wjInput.WjMenu, wjInput.WjMenuItem,
                    FORM_DIRECTIVES , CORE_DIRECTIVES],
        providers: [LoggerService, RessourceService]
    })
    

    HTML

    <wj-flex-grid #flex [allowResizing]="'Both'"
                  class="grid"
                  [itemsSource]="ressources"
                  [isReadOnly]="false"
                  [allowAddNew]="true">
        <wj-flex-grid-column [header]="'ID'" [binding]="'Key'" [width]="80"></wj-flex-grid-column>
        <wj-flex-grid-column [header]="'string'" [binding]="'ContentString'"></wj-flex-grid-column>
        <wj-flex-grid-column [header]="'Product'"
                             [binding]="'Key'">
            <template wjFlexGridCellTemplate [cellType]="'Cell'" #cell="cell">
                <button>
    
                </button>
            </template>
        </wj-flex-grid-column>
    </wj-flex-grid>
    

    Error:

    browser_adapter.js:77 Error: Uncaught (in promise): Template parse errors:

    There is no directive with “exportAs” set to “cell” (" [binding]=“‘Key’”>

    <template wjFlexGridCellTemplate [cellType]=“‘Cell’” [ERROR ->]#cell=“cell”>

  • Posted 14 September 2017, 11:37 am EST

    Hello

    You should use

    let-cell="cell"
    instead of
    #cell="cell"
    , the syntax was changed in Beta.17:

    https://github.com/angular/angular/blob/master/CHANGELOG.md#200-beta17-2016-04-28

    Thanks,

    Alex

  • Posted 7 February 2019, 11:23 am EST

    Hi- directives has been removed in Angular 7. Can you please provide the alternate solution to insert a template inside a column. I am trying since while but couldn’t achieve it. Appreciate your help.

    Thanks, Mayank

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels