Articles in this section
Category / Section

How to hide '$' symbol in OLAP Grid value cell?

1 min read

This KB illustrates that how to remove currency symbol in 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/>

 

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