We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Groupings not working for server side using UrlAdaptor

Hi I'm extending UrlAdaptor to process the result from my web service and the paging and sorting is working well but I'm getting error when using groupings.
grouping.PNG
please see attach code


3 Replies

PK Prasanna Kumar Viswanathan Syncfusion Team April 10, 2017 02:50 PM UTC

Hi Mervin, 

Thanks for contacting Syncfusion support. 

We created a sample with the attached code example and we can reproduce the mentioned issue while grouping. In your code example we found that you return have the result and count in the processResponse method. By default, the grouping is done in client-side only. So, we need to process the grouping query and return the result and count. To achieve this, use the below code example.  

Find the code example and sample:  


<script type="text/javascript"> 
        var dataManager = ej.DataManager({ 
            url: "/Grid/DataSource", 
            adaptor: new ej.UrlAdaptor() 
        }); 
 
        var customAdaptor = new ej.UrlAdaptor().extend({ 
            processResponse: function (data, ds, query, xhr, request, changes) { 
                result = this.base.processResponse.apply(this, [data, ds, query, xhr, request, changes]); 
                return result; 
            }, 
        }); 
 
        $(function () {// Document is ready. 
            $("#Grid").ejGrid({ 
                dataSource: dataManager, 
                allowPaging: true, 
                --------------------------- 
               allowGrouping : true, 
                columns: [ 
                          --------------------------- 
               ], 
            }); 
        }); 
    </script> 


Regards, 
Prasanna Kumar N.S.V 
 



ME Mervin April 11, 2017 05:11 AM UTC

Hi Prasanna 

Awesome fix! thank you.


PK Prasanna Kumar Viswanathan Syncfusion Team April 12, 2017 04:14 AM UTC

Hi Mervin, 

We are happy to hear that your issue has been resolved. 

Please let us know if you need any further assistance. 

Regards, 
Prasanna Kumar N.S.V 


Loader.
Live Chat Icon For mobile
Up arrow icon