JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › Data Grid › Custom Grid Header with Template and Buttons
Tagged: blazor grid custom header
- This topic has 3 replies, 2 voices, and was last updated 1 year, 1 month ago by Markov.
-
AuthorPosts
-
September 21, 2023 at 5:34 pm #108750FerrisChampParticipant
Hello,
I am trying to make a custom grid header with a template and buttons.
I have a div marked for the template but it doesn’t seem to work with the buttons[] function. The buttons seem to be overridden. I saw this thread: https://www.htmlelements.com/forums/topic/customize-toolbar/#post-103322 and I’m trying to implement this, but I am having trouble. I’d like to put the buttons in the template. I am getting errors with the filterButton and querySelector. Any help would be appreciated!
<MudPaper id=”gridHeader”>
<MudToolBar Class=”justify-space-around”>
<div>
<MudButton Class=”smart-grid-header-button” Variant=”Variant.Filled” StartIcon=”@Icons.Material.Filled.Settings” Size=”Size.Small”>Actions</MudButton>
<MudButton id=”filterButton” Class=”smart-grid-header-button” Variant=”Variant.Filled” StartIcon=”@Icons.Material.Filled.Settings” Size=”Size.Small”>Filter</MudButton>
<MudButton id=”groupButton” Class=”smart-grid-header-button” Variant=”Variant.Filled” StartIcon=”@Icons.Material.Filled.Settings” Size=”Size.Small”>Group</MudButton>
<MudButton id=”sortButton” Class=”smart-grid-header-button” Variant=”Variant.Filled” StartIcon=”@Icons.Material.Filled.Settings” Size=”Size.Small”>Sort</MudButton>
<MudButton Class=”smart-grid-header-button” Variant=”Variant.Filled” StartIcon=”@Icons.Material.Filled.AcUnit” Size=”Size.Small” OnClick=”@OpenFreeze”>Freeze</MudButton>
<MudOverlay Visible=”@FreezeOpen” AutoClose=”true” />
<MudPopover Open=”@FreezeOpen” AnchorOrigin=”Origin.BottomCenter” TransformOrigin=”Origin.TopCenter”
Class=”pa-2″>
<MudStack Spacing=”0″>
<MudStack Spacing=”0″ Style=”overflow-y:auto;max-height:250px”>
@foreach (DocumentField field in Document.DocumentFields)
{
<MudCheckBox T=”bool” Size=”@Size.Small” Checked=”@(tempFrozenColumns.Contains(field.FieldName))” Label=”@field.AliasName”
CheckedChanged=”@((value) => FrozenSelectedChanged(value, field.FieldName))” />
}
</MudStack>
<MudStack Row=”true” Class=”justify-space-evenly mt-2″>
<MudButton OnClick=”@(() => ClearFrozen())”>Clear</MudButton>
<MudButton Color=”@Color.Primary” OnClick=”@(() => ApplyFreeze())”>Freeze</MudButton>
</MudStack>
</MudStack>
</MudPopover>
</div>
<MudSlider Size=”Size.Medium” ValueChanged=”@((int value) => Zoom(value))” Variant=”Variant.Filled” Min=”50″ Max=”150″ Step=”10″ TickMarks=”true” Style=”width: 20%;”>Zoom: @zoomPercent</MudSlider>
</MudToolBar>
</MudPaper>GridHeader header = new GridHeader()
{
Visible = true,
Buttons = new string[] { “search”, “format”, “group”, “filter” },
Template = “#gridHeader”,
OnInit = (toolbar) =>
{
const filterButton = toolbar.querySelector(‘div[smart-id =”sortButton”]’);
filterButton.classList.add(‘custom-button’);
}
};Thank you!
Ferris DeHart
September 22, 2023 at 8:21 am #108766MarkovKeymasterHi Ferris DeHart,
Could you send a full example to support@jqwidgets.com which demonstrates the reported behavior?
Best Regards,
MarkovSmart UI Team
https://www.htmlelements.com/September 22, 2023 at 6:47 pm #108774FerrisChampParticipantHello,
I keep trying to send an email, but I am getting rejected by your spam filters. How can I get around that?Thank you,
Ferris
September 25, 2023 at 6:36 am #108786MarkovKeymasterHi Ferris,
We use gmail as an email service i.e i suppose it’s rejected if you attach a .zip or other archive. You can create a github repo with the example and send a link to it. The email will not reject you then.
Best Regards,
MarkovSmart UI Team
https://www.htmlelements.com/ -
AuthorPosts
- You must be logged in to reply to this topic.