Hi Simone,
Thanks for contacting Syncfusion Support.
You can enable Conditional Formatting by using RenderSuccess event in PivotClient. Please refer below code snippet and sample screenshot for your reference.
Code Snippet: [html]
|
<div>
<div style="margin-top:10px">
Conditional Formatting:
</div>
<div style="margin-top:15px">
<button class="cusBtn" id="Btn1">
Apply
</button>
<button class="cusBtn" id="Btn2">
Reset
</button>
</div>
</div> |
Code Snippet: [cshtml]
|
@Html.EJ().Pivot().PivotClient("PivotClient1").Url(Url.Content("~/api/OlapClient")).Title("OLAP Browser").ClientSideEvents(oEve => { oEve.RenderSuccess("renderSuccess") }) |
Code Snippet: [javascript]
|
<script>
var pivotGridObj;
function ApplyChanges() {
if (pivotGridObj.model.enableConditionalFormatting) {
pivotGridObj.openConditionalFormattingDialog();
}
}
function Reset() {
pivotGridObj._removeCellFormatting(true, false);
pivotGridObj._list = ["Add New"];
}
function renderSuccess(args) {
this._pivotGrid.model.enableConditionalFormatting = true;
pivotGridObj = this._pivotGrid;
$("#Btn1").ejButton({
roundedCorner: true,
size: "small",
type: ej.ButtonType.Button,
click: "ApplyChanges"
});
$("#Btn2").ejButton({
roundedCorner: true,
size: "small",
type: ej.ButtonType.Button,
click: "Reset"
});
}
</script> |
Screenshots:
Meanwhile, we have created prototype sample for Conditional Formatting in PivotClient. Please find the sample in below link.
Please let us know if you have any queries.
Thanks,
Manikandan.