Articles in this section
Category / Section

How to hide '$' symbol in OLAP JavaScript PivotGrid value cell?

1 min read

This KB illustrates that how to remove currency symbol in JavaScript PivotGrid value cell.

Solution:

You can remove the currency symbol besides each value in the value cell of the PivotGrid using the following code example.

JavaScript

$(function () {
$("#PivotGrid").ejPivotGrid({
url: "../wcf/OLAPService.svc", afterServiceInvoke: "OnChangeCellText"
});
});
function OnChangeCellText(args) {
var JsonData = this.getJSONRecords();
for (i = 0; i < JsonData.length;i++)
JsonData[i].Value = JsonData[i].Value.replace("$", "");
this.setJSONRecords(JSON.stringify(JsonData));
}

ASP

<ej:PivotGrid ID="PivotGrid1" runat="server" Url="../wcf/PivotGridtService.svc">
<ClientSideEvents  AfterServiceInvoke="OnChangeCellText"/> </ej:PivotGrid>
<script type="text/javascript">
function OnChangeCellText(args) {
var JsonData = this.getJSONRecords();
for (i = 0; i < JsonData.length;i++)
JsonData[i].Value = JsonData[i].Value.replace("$", "");
this.setJSONRecords(JSON.stringify(JsonData));
}
<script/>

MVC

@Html.EJ().Pivot().PivotGrid("PivotGrid1").Url(Url.Content("~/wcf/PivotGridService.svc")).ClientSideEvents(clientSideEvent => clientSideEvent.AfterServiceInvoke("OnChangeCellText"))
<script type="text/javascript">
function OnChangeCellText(args) {
var JsonData = this.getJSONRecords();
for (i = 0; i < JsonData.length;i++)
JsonData[i].Value = JsonData[i].Value.replace("$", "");
this.setJSONRecords(JSON.stringify(JsonData));
}
<script/>

 

Conclusion

I hope you enjoyed learning about how to hide the '$' symbol in OLAP JavaScript PivotGrid value cell.

You can refer to our JavaScript PivotGrid 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 PivotGrid 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