Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
45
IgxGrid with custom summaries
posted

Hello, I want to make custom summaries with different "operate" methods, depending on a variable. Something like this:

But the variable is not defined inside the "operate" method, is defined somewhere else. I've tried several approaches but none worked.

Is there any way possible to do this?

Thanks

Parents
  • 1080
    Offline posted

    Hello Gabriel,

    Thank you for posting in our community.

    Can you please clarify what are you trying to achieve?

    I have created a sample in StackBlitz based on the provided screenshot. Please fork it, modify it to meet your requirement(despite of the errors that may occur) and share the link.

  • 45
    Offline posted in reply to Martin Asenov

    Hello Martin,

    I've added some comments explaining what I'm trying to achieve in this
    sample.

    I've tried some different solutions, but none worked. Defining a static variable inside MySummary class wouldn't work because the 'operate()' method is not in a static context. Defining the variable 'types' to be received in the constructor wouldn't work because MySummary class is not instantiated. Other approaches that I've thought wouldn't work because of the lifecycle of the component.

    What I'm trying to do is making the content of summaries (sum, count, avg...) not dependent on the 'dataType', it would be dependent on the 'types' variable instead.

    I expect that with this answer I could make you understand what I'm trying to achieve.

    Thanks

Reply Children