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
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
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
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
Hello,
Thanks for your answer but it's not exactly what I need because I don't have my scope context in customizeCellFunction
and I don't know if I must apply style.
it's not possible to wrap customizeCellFunction
to send another context in parameter ?
Hello Julien,
Thank you for your feedback.
You can make the context available by using ES6
syntax. Here is an example: https://jsfiddle.net/flexmonster/Lmx4p4os/57/.
The alternative approach is to bind the context explicitly by using js .bind()
method.
Please let us know if you managed to resolve the issue.
Regards,
Dmytro