We have a grid column that is display date in M/DD/YYYY format. The Data set for this date column includes a time value. When the user groups by this column the grouping is including the time so there are many groups for the same date. Is there a way to tell the grid to ignore the time for the grouping? I would have assumed it would grouped based on the format displayed to the user but its not working that way.
Yours looks similar to mine. The only difference is you're defining in the cshtml and we're defining using GridGroupByWrapper in the cs. Do you think something could be missing with that?
Hello Tammy,
I'm attaching a MVC sample with remote GroupBy. The compareFunc is attached to the "window" object in order to trigger.
Best regards, Martin Pavlov Infragistics, Inc.igGrid_Sample_MVC5.zip
I can't get it to trigger. I set it up similar to the column FormatterFunction and couldn't get it to work that way either. I don't know if its not triggering because we're using MVC or because we're using remote instead of local. I need more guidance.
If you can confirm that the custom function is executed when grouping, could you please try changing it with the following code:
gridCompareDateFunc: function (val1, val2, recordsData) { var d1 = new Date(val1), d2 = new Date(val2); if (d1.getYear() === d2.getYear() && d1.getMonth() === d2.getMonth() && d1.getDay() === d2.getDay()) { return 0; } return Math.sign(val1 - val2);}
I hope this helps!
Best regards,
Stamen Stoychev
Ok this customer reported so please keep me in the loop.