Articles in this section
Category / Section

How to check axis where measure or SplitButton in JS PivotClient?

2 mins read

This KB illustrates that how to check the axis where measure or SplitButton, is present JavaScript PivotClient.

Solution:

You can check the presence of measure in row or column axis using the following code example with respective to JS, ASP and MVC platforms.

JavaScript

<div id="customBtn" style="margin-left:5px;">FindMeasureButton</div>
<div id="PivotClient1" style="min-height: 275px; min-width: 525px;"/>
<script type="text/javascript">
$(function () {
            $("#PivotClient1").ejPivotClient({ url: "../wcf/OlapClientService.svc", title: "OLAP Browser", chartLoad: "AddingCustomButton" });
}); 
$("#customBtn").ejButton({
           size: "normal",
           showRoundedCorner: true,
           click: "btnClick",
 });
function AddingCustomButton(args) {
$(".reportToolbar").append($("#customBtn"));
}
function btnClick(e) {
alert("Measure is presented at" + $("div[tag*=':Measures']").attr("tag").split(':')[0]);
}
<script/>

MVC

@Html.EJ().Pivot().PivotClient("PivotClient1").Url(Url.Content("~/wcf/OlapClientService.svc")).Title("OLAP Browser").ClientSideEvents(oEve => { oEve.ChartLoad("AddingCustomButton"); }) 
@Html.EJ().Button("customBtn").Text("FindMeasureButton").Size(ButtonSize.Normal).ShowRoundedCorner(true).ClientSideEvents(e => e.Click("btnClick"))
<script type="text/javascript">
function AddingCustomButton(args) {
$(".reportToolbar").append($("#customBtn"));
}
function btnClick(e) {
alert("Measure is presented at" + $("div[tag*=':Measures']").attr("tag").split(':')[0]);
}
<script/>

ASP

<ej:PivotClient ID="PivotClient1" runat="server" Url="../wcf/OlapClientService.svc">
        <ClientSideEvents  ChartLoad="AddingCustomButton" />
</ej:PivotClient>
<ej:Button ID="customBtn" runat="server" Size="Large" Type="Reset" OnClick="btnClick" ShowRoundedCorner="true" Text="FindMeasureButton"></ej:Button>
<script type="text/javascript">
function AddingCustomButton(args) {
$(".reportToolbar").append($("#customBtn"));
}
function btnClick(e) {
alert("Measure is presented at" + $("div[tag*=':Measures']").attr("tag").split(':')[0]);
}
<script/>

 


Conclusion

I hope you enjoyed learning on how to check axis where measure or SplitButton in JS PivotClient.

You can refer to our JavaScript PivotClient feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our JavaScript PivotClient example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!



Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied