Posted 24 October 2022, 9:24 pm EST - Updated 24 October 2022, 9:29 pm EST
Override the Data Type Formatting Functionality
Posted by: sharaththota.zem on 24 October 2022, 9:24 pm EST
-
-
Posted 27 October 2022, 6:39 pm EST - Updated 27 October 2022, 6:44 pm EST
Hi,
To overwrite the functionality of the Formatting as seen in the screenshot you shared, you must overwrite the “Designer.setFormatter” command.
You can also use the getFormatter() method to get the formatter and compare it to the culture’s predefined formats to determine its type, such as ‘Accounting,’ ‘Number,’ ‘General,’ and so on.
Please see the following sample that I prepared for you: https://jscodemine.grapecity.com/share/jVfYZkQB_0eX9-_5DBWsbw/
Also, I’m not sure why you’re attempting to replace the existing formatter. You can also design your own formatter based on your needs.
Please try the above solution and let us know if you run into any problems. We would be delighted to assist you. Also, please explain your use case so that we can get a better understanding of it and assist you accordingly.
Please also see the references below for creating custom formatters and customizing the Format Culture Dialog.
API References:
Customize Format Culture Dialog: https://www.grapecity.com/spreadjs/docs/spreadjs_designer_component/customizations/designer-customize-culture
getFormatter method:
https://www.grapecity.com/spreadjs/api/classes/GC.Spread.Sheets.Worksheet#getformatterCustom Formatter: https://www.grapecity.com/spreadjs/demos/features/cells/formatter/custom-formatter/purejs
Regards,
Ankit