【问题标题】:Clarity datagrid how to replace a row when using ngProjectAs?使用ngProjectAs时,Clarity datagrid如何替换一行?
【发布时间】:2018-07-13 03:42:45
【问题描述】:

为了在展开时替换一行,文档如下所示:

<clr-dg-row *ngFor="let user of users">
    <-- Cells declarations -->
    <clr-dg-cell>...</clr-dg-cell>

    <clr-dg-row-detail *clrIfExpanded [clrDgReplace]="true">
        Lorem ipsum...
    </clr-dg-row-detail>
</clr-dg-row>

这可行,但我也想用我自己的组件替换&lt;clr-dg-row-detail&gt;,这样我就可以延迟加载详细信息。文档如下所示:

<clr-dg-row *ngFor="let user of users">
    <-- Cells declarations -->
    <clr-dg-cell>...</clr-dg-cell>

    <my-detail *clrIfExpanded [user]="user" ngProjectAs="clr-dg-row-detail"></my-detail>
</clr-dg-row>

我尝试将[clrDgReplace]="true" 放在我的自定义组件和 ngProjectAs 内部,但它会引发错误。任何帮助将不胜感激。

【问题讨论】:

    标签: angular vmware-clarity


    【解决方案1】:

    [clrDgReplace]="true" 需要在&lt;clr-dg-row-detail&gt; 元素本身上,它是行详细信息组件的输入。 因此,在您的情况下,&lt;clr-dg-row-detail [clrDgReplace]="true"&gt; 在您的自定义组件的模板中。

    【讨论】:

    • 完美运行!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-23
    • 2014-04-13
    • 2020-07-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多