Setting up your Grid implementation should go smoothly. However, like all software, there are places where things can go wrong. Here are specific instructions for troubleshooting common problems.
General Troubleshooting Approaches
There are some good general techniques from troubleshooting Ajax problems which apply to not just Nitobi components, but all JavaScript and Ajax software. Here are a couple of the things you should try first:
Use Proxy Tracing (Microsoft Fiddler)
A good proxy tracing tool like Microsoft Fiddler will help you detect problems in your server code, even if you dont see any visible sign of problems in the browser. This is probably the single most useful development tool for Ajax. We are maintaining a detailed explanation of debugging with Fiddler here in our knowledgebase. Click here to read it (highly recommended). Alternatively you can get the printable version.
Use a JavaScript Debugger
There are some good JavaScript debuggers available that can really shorten development time in the way that desktop debuggers do. One is Venkman (for Mozilla / Firefox), and another is the MS Script Debugger (for IE).
Common Problems
Problem: The Grid doesn't appear or won't initialize.
1. Solution: Namespace isn't defined.
The html page where the grid tag appears must contain the Nitobi namespace. put this in the tag at the top of the page. Eg:
2. Solution: JavaScript component isn't loading.
For some reason, the nitobi.grid.js component might not be loading. Is it referenced correctly? Is the client browser Internet Explorer 5.5 or newer?
3. Solution: nitobi.loadComponent is not called.
When the page is loaded, nitobi.loadComponent must be called. In your tag, use the onLoad property to call nitobi.loadComponent, either directly, or through a JavaScript function. Eg:
4. Solution: Improperly defined Grid Tag
An incorrectly defined HTML Grid tag may cause the grid to not appear. Consult the included demos for an example of a properly formed grid tag.
1. Solution: Missing or incorrectly Referenced Style Sheet
This is probably due to the stylesheet being incorrectly referenced. Did you copy the styles into your application folder? Here is an example of a correct CSS reference appearing in the tag of your page:
2. Solution: There is a DOCTYPE declaration on the page
Currently, the Grid does not work in standards mode, only quirks mode. If you have a DOCTYPE declaration on your page, you should remove it.
1. Solution: Grid columns not bound to data columns
Every column in the grid must reference (with the property xdatafld) a column of data in the datasource.
2. Solution: There is a problem with the getHandler.
To see if the getHandler is working correctly, try calling directly in your browser. If your getHandler is gethandler.asp, simply call it in your browser window and then View Source. You should see a properly formatted XML stream like this:
If not, you will probably get a server error. Check your file permissions and troubleshoot the script as you would any other. Refer to the server-side XML API documentation included with the Grid.
First and foremost, you should check your file permissions. By default, the included samples may not have appropriate file permissions required in order to save your data. In Windows, you should right click on the database, hit properties and check that: a) The database is not Read-Only - b) In the Security tab, the user "Everyone" has Full Control over reading and writing.
2. Solution: There is another problem with your save handler!
Any number of things could be wrong with the save handler. The trouble with debugging them is you must deliver an XML updategram and view the results to see what is happening. The best way to do this is to use Fiddler to view the response from the server.