Hello!,
I'm using the grid component and have a column with a template where I'm using the Chip component inside. There are some problems that I'm facing and could use some help in sorting them
- As you can see on the code bellow, I'm initializing the Chip componente with a static chip (and hiding it with css) because if I don't do this no chips appear. so thats why I have this code <ChipListChip Text="Chips" Enabled="false" CssClass="hideChip"></ChipListChip>
- As I filter the grid by the tags, there are lines that start multiplying its chips and get more and more as I remove and add filters. You can see it happening on the Gif in attachment. Is there a way to prevent this?
Please check the code below for the grid. There is almost no CS code since I'm using the adaptor to get data.
<EjsGrid TValue="OrganizationCraft" AllowGrouping="true" AllowPaging="true" Height="100%" Width="100%" AllowFiltering="true">
<EjsDataManager AdaptorInstance="@typeof(CraftOrganizationAdaptor)" Adaptor="Adaptors.CustomAdaptor"></EjsDataManager>
<GridPageSettings PageCount="5" PageSizes="true"></GridPageSettings>
<GridGroupSettings ShowDropArea="@BelongsToAdministratorOrganization" Columns="@GroupedColumns"></GridGroupSettings>
<GridColumns>
<GridColumn Field=@nameof(OrganizationCraft.OrganizationName) HeaderText="Organization" Visible="@BelongsToAdministratorOrganization"></GridColumn>
<GridColumn Field=@nameof(OrganizationCraft.Name) HeaderText="Name" AllowGrouping="false"></GridColumn>
<GridColumn Field=@nameof(OrganizationCraft.NominalAltitude) HeaderText="Nominal Altitude" Format="N0" AllowFiltering="false" Type="ColumnType.Number" AllowGrouping="false"></GridColumn>
<GridColumn Field=@nameof(OrganizationCraft.FieldOfView) HeaderText="Field of View" Format="N0" AllowFiltering="false" AllowGrouping="false"></GridColumn>
<GridColumn Field=@nameof(OrganizationCraft.Type) HeaderText="Type" AllowGrouping="false"></GridColumn>
<GridColumn Field=@nameof(OrganizationCraft.Tags) HeaderText="Tags" AllowGrouping="false">
<Template>
@{
var organizationCraft = (context as OrganizationCraft);
if (organizationCraft.Tags.Any())
{
<EjsChipList EnableDelete="false">
<ChipCollection>
@foreach (string chip in organizationCraft.Tags)
{
<ChipListChip Text="@chip" CssClass="e-info"></ChipListChip>
}
<ChipListChip Text="Chips" Enabled="false" CssClass="hideChip"></ChipListChip>
</ChipCollection>
</EjsChipList>
}
else
{
<span></span>
}
}
</Template>
</GridColumn>
</GridColumns>
<GridEvents TValue="OrganizationCraft"></GridEvents>
</EjsGrid>
Attachment:
GridChipMultiplier_dfbab67d.7z