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

Grid not displaying records after requery

I have an ejGrid on an MVC view that is autogenerating the columns in the grid via a datamanager that uses an ej.WebApiAdaptor().  This works the first time I run the query.  However, when I do a requery the grid often returns 'No records to display'.  When I check the actual Web API for the query it always returns the data.  This suggests to me that the grid itself is not rendering it after the first time.  Any ideas? The code for the datamanager and the grid is below.  Note that urlStr is good as I use this to check the Web API service that it references:

 var dataManager = ej.DataManager({
                url: urlStr,
                enableCaching: false,
                crossDomain: true,
                adaptor: new ej.WebApiAdaptor(),
                offline: true
            });

            $("#Grid").ejGrid({
                dataSource: dataManager,
                recordDoubleClick: function (args) { SelectedRow(args, archiveURLPath) },
                allowPaging: true,
                pageSettings: { pagesize: 12 },
                actionComplete: function (args) {

                    var gridObj = $("#Grid").ejGrid("instance");
                    if (args.requestType == "refresh" && flag == true) {
                        flag = false;
                        gridObj.hideColumns("Id");
                    }
                }
            });

1 Reply

SS Seeni Sakthi Kumar Seeni Raj Syncfusion Team December 23, 2016 11:19 AM UTC

Hi Stephen, 
 
Thanks for contacting Syncfusion Support.  
 
We are unable to reproduce any problem with the provided code example. We have prepared a sample that can be downloaded from the following location. 
 
 
You have quoted “when I do a re-query the grid often returns 'No records to display'”. But we cannot send POST again after the initial render of the Grid. Since you have given offline as “true”, all the data will be load at the initial render of the Grid. So further actions taken in the Grid will be performed at the client-end itself. Can you please explain the way that you are perform re-querying? Also, provide the following details to analyze the problem. 
 
1)      Code example of the Code behind 
2)      Stack Trace of browser console (if any error) 
3)      Exact replication procedure to reproduce the problem at our end 
4)      Screenshot for the issue 
5)      Version of the Essential Studio 
6)      If possible, modify the attached sample and reproduce the problem at our end 
 
Regards, 
Seeni Sakthi Kumar S. 


Loader.
Live Chat Icon For mobile
Up arrow icon