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

URL ADAPTOR y VIRTUALSCROLLING EN TREEGRID

Que tal, quiero saber si es posible utilizar URL adaptor para mostrar los datos en un treegrid,
y utilizar virtualscrolling al igual que un grid normal, ya que quiero cargar miles de datos, y cargar todos a la vez es muy tardado.

es posible?, ya que he intentado y no me funciona.

de antemano muchas gracias.

3 Replies

JS Jonesherine Stephen Syncfusion Team December 8, 2016 05:26 PM UTC

Hi Cesar, 
Thanks for contacting Syncfusion support 
In TreeGrid we can load large number of data by using “enableVirtualization” property. We have prepared the sample and populated 1000 records by using URL adaptor in virtualization mode.  
Please find the code example below 
[view] 
@(Html.EJ().TreeGrid("TreeGridContainer") 
       .EnableVirtualization(true)      
       .Datasource(ds => ds.URL("/TreeGrid/GetTreeGridData").Adaptor(AdaptorType.UrlAdaptor)) 
    ) @(Html.EJ().ScriptManager()) 
 
 
[controller] 
public JsonResult GetTreeGridData() 
        { 
            var Data = db.TreeGridDatas.ToList();            
            return Json(Data, JsonRequestBehavior.AllowGet); 
        } 
We have also prepared the sample based on this, please find the sample from below location 
 
Disclaimer: We have removed bin and obj folder in the given sample for some security reasons, we must include Syncfusion.EJ, Syncfusion.EJ.MVC, dlls to render the TreeGrid control which is available in Essential Studio installed location.   
Please let us know if you require further assistance on this.
Regards, 
Jone sherine P S
  



CV César Ventura December 8, 2016 06:42 PM UTC

Hola Jonesherine Stephen!
Gracias por tu pronta respuesta,
ya lo implemente de la manera que me indican, pero al ejecutar me aparece el error:

executeQuery() : A query is required to execute
Error: DataManager - executeQuery() : A query is required to execute

y no me muestra información, ni tampoco el treegrid, que puedo hacer para solucionarlo?


JS Jonesherine Stephen Syncfusion Team December 9, 2016 12:49 PM UTC

Hi Cesar, 
Sorry for the inconvenience caused. 
We have analysed the reported issue with our sample. To render the TreeGrid with ejDataManager the query should be a valid one. It won’t be an empty string. Can you please ensure whether the valid query is provided in a “query” property in your sample?  
We have also prepared the sample with “query” and fetched 10 records by using “take” property.  
Please find the code example below: 
[view] 
 
@(Html.EJ().TreeGrid("TreeGridContainer")        
       .Query("new ej.Query().take(10)")        
       .Datasource(ds => ds.URL("/TreeGrid/GetTreeGridData").Adaptor(AdaptorType.UrlAdaptor)) 
    ) 
    @(Html.EJ().ScriptManager()) 
 
[controller] 
  public JsonResult GetTreeGridData(Syncfusion.JavaScript.DataManager dm) 
        { 
            var Data = db.TreeGridDatas.ToList(); 
            var result = Data.Take(dm.Take); 
            return Json(result, JsonRequestBehavior.AllowGet); 
        } 
We have prepared the sample in version 14.4.0.15 for your reference.  
Please find the sample from below location 
If still the problem exists at your end, please revert us by modifying the sample based on your application along with the replication procedure. This would be helpful for us to serve you. 
Please let us know if you need further assistance on this, 
Regards, 
Jone sherine P S 


Loader.
Live Chat Icon For mobile
Up arrow icon