Sep 04, 2010, 2:47 AM
[1.0 FAQ] Why doesn't my Grid display?...
Maybe this can become the humble beginnings of a "Why the grid doesn't display" FAQ ?
The tricky part about using extjs and Ext.Net is that it's every detail is subtle and frequently without clues to why that one thing you expect doesn't work the way you expect. Like HTML once was upon a time past, there is as much artform as there is science in volved and experience reigns king.
So I started to look at my current problem and I asked, why doesn't my grid display?
So to start on the list of many reasons, I present the following (start):
Control-Problems
The tricky part about using extjs and Ext.Net is that it's every detail is subtle and frequently without clues to why that one thing you expect doesn't work the way you expect. Like HTML once was upon a time past, there is as much artform as there is science in volved and experience reigns king.
So I started to look at my current problem and I asked, why doesn't my grid display?
So to start on the list of many reasons, I present the following (start):
Control-Problems
- Check your Panel, is it possible that the height hides the grid from view? Sometimes autoheight and layout="fit" behaves unexpectedly and clips the view. If your panel allows, temporarily substitute with Height="600" Width="400".
- Check to make sure your grid contro isn't hidden="true" or a class hasn't been assigned a class or style to hide it. Check client-side and server side reference.
- Make sure you have attached your store correctly. It is critical that your grid reference the correct store. Sometimes you reference the wrong one or one that doesn't exist. Ext.net has gotten better on warnings.
- Your store may retrieve an empty result set. If HideHeaders="true", you won't see the headers and the view will be enitrely empty. If you databind on the server-side, you should be able to step through your code and check the count.
- If you bind to a list of class objects, e.g. List<Company>, make sure your class has properties with { get; } access. If you don't, you'll find your view-source will not show any values passed to the construction of PagingMemoryProxy required to bind.
- Make sure you haven't set AutoLoad="false". This will cause the binding to never occur and requires client-side code to .load().
- If you are binding to a List<> or collection, make sure that you have not set a Root for your JsonReader.
- Make sure your store proxy isn't returning an empty result set. You may have to trap on the server service request or handler to ensure that its even being called. You can also check that the result has a count.
- Use Fiddler2 (or other debugging tool) to verify that your proxy is being referenced through the web. You should see a full request header.
- If you are using a JsonReader, make sure your Root is correct and present.
- ...
Last edited by michaeld; Sep 04, 2010 at 2:52 AM.