GroupOption using captionTemplate function KEY undefined

Hello. 

Im trying to use your component, currenty trial, just to proof my concept. 


I have grouping on boolean columns. I need to localize values (true/false) into my lang or clients lang .. 

I try this. It works great. BUT props.key does not exists, its always undefined. It is most likely bug .. but i cant find way to make this wokrs other way. Can you explain to me, why you have it like this? Im considering using your components, but these errors is not good and If I choose your components for my projects, I really dont want to have to solve such errors commonly becouse of your components .. thank you for your answer, have a nice day

let groupOptions = {
        showDropArea: true,
        captionTemplate: (props: any) => {
            return (
                <span className="groupItems" style={{ color: '#FFC600' }}>
                    {t('itemsHeader')}: {props.key} - {props.count} {t('items')}
                </span>
            );
        }
    };

3 Replies

AR Aishwarya Rameshbabu Syncfusion Team April 10, 2025 12:02 PM UTC

Hi Michal Nekvasil,



Greetings from Syncfusion support.



Upon reviewing the provided details, it has been observed that you are experiencing an issue wherein the `props.key` is consistently undefined within the Group `captionTemplate` of the Syncfusion Grid. This issue has been resolved in our release (Version 28.2.11) by utilizing the `groupKey` property to pass the key value to the `captionTemplate` function. We kindly recommend updating your Syncfusion package to version 28.2.11 or above to address this issue effectively. For further clarification, please refer to the updated sample, accompanying screenshot, and the relevant documentation.



Sample: Tmxnwgsx (forked) - StackBlitz


Screenshot:



Documentation Link: Update-npm-package


Release Notes: 28.2.11


If you need any other assistance or have additional questions, please feel free to contact us.



Regards,

Aishwarya R



MN Michal Nekvasil April 11, 2025 05:47 AM UTC

Thank you very much, I dont know im using such old version.


Have a nice day!



SR Sivaranjani Rajasekaran Syncfusion Team April 14, 2025 05:44 AM UTC


You are most welcome! Please get back to us if you need further assistance.

Loader.
Up arrow icon