Send optional custom parameter to customizeCell function

Hi,
I’ve got the specific cells format in json object and I would like to apply it in customizeCell function.
Is it possible to send optional parameter to this function ?
B.Regards
Julien Puleo

3 answers

Public
Dmytro Zvazhii Flexmonster March 20, 2018

Hello Julien,
Thank you for your question. The customizeCell function does not allow sending additional custom parameters. Still, could you please give us some more information about your use case? It will be much easier for our dev team to find an appropriate solution.
Waiting for the update from you.
Regards,
Dmytro

Public
Julien PULEO April 11, 2018

Hello Dmytro,
My case is easy, I’ve got in object all information about, background color, color, font, etc… for total and subtotal, and I would like to access of my object in customizeCell to use and apply it.
Waiting for the update from you.
Regards
Julien

Public
Tanya Gryshko Flexmonster April 11, 2018

Hello, Julien,
Thanks for specifying the details of your case.
We can suggest you the following approach:
1. Add certain CSS classes to subtotal and total cells in customizeCellFunction.
2. Define these CSS classes elsewhere in your code using the information from JSON object with the specific cells format.
Please check this sample: https://jsfiddle.net/flexmonster/Lmx4p4os/
Here customizeCellFunction adds three CSS classes:

function customizeCellFunction(cell, data) {
if (data.isClassicTotalRow) cell.addClass("fm-total-classic-r");
if (data.isGrandTotalRow) cell.addClass("fm-grand-total-r");
if (data.isGrandTotalColumn) cell.addClass("fm-grand-total-c");
}

These CSS classes are defined directly in CSS box and you can add them dynamically.
Please let me know if you have further questions.
Regards,
Tanya

Please login or Register to Submit Answer