Events
The Telerik UI PivotGrid for ASP.NET Core exposes multiple events that allow you to control the behavior of the UI component.
The following example demonstrates how you can subscribe to the ExpandMember
and CollapseMember
events of the component.
@(Html.Kendo().PivotGrid()
.Name("pivotgrid")
.Events(e =>
{
e.ExpandMember("onExpandMember");
e.CollapseMember("onCollapseMember");
})
... // Other configuration.
)
<script>
function onExpandMember(e) {
console.log(e); // Review the event data.
// Custom logic when a specified column or row field is expanded.
}
function onCollapseMember() {
console.log(e); // Review the event data.
// Custom logic before a specified column or row field is collapsed.
}
</script>
<kendo-pivotgrid name="pivotgrid" datasource-id="pivotSource" on-expand-member="onExpandMember" on-collapse-member="onCollapseMember">
<!--Other configuration-->
</kendo-pivotgrid>
<script>
function onExpandMember(e) {
console.log(e); // Review the event data.
// Custom logic when a specified column or row field is expanded.
}
function onCollapseMember() {
console.log(e); // Review the event data.
// Custom logic before a specified column or row field is collapsed.
}
</script>