EJS TreeGrid documentation
Debug window
TreeGrid 6.0 contains new feature for debugging: a debug window.
The window shows various information from TreeGrid runtime. Errors, warning, timer, status and so on.
This window is displayed on bottom of page by default, the position can be changed in Grid.css, CSS attribute GridDebugTag.
The window is shown automatically if some message is printed or on click to Debug icon on toolbar.
What will be printed to the debug window is controlled by <treegrid> / <bdo> attribute Debug.
<treegrid,bdo> string[] Debug [“Problem,IOError”] new 6.0.
Global debugging settings.
A list of comma separated keywords specified what information will be printed to the Debug window. The keywords are case insensitive.
Default setting of Debug is to print all errors and warning, it strongly recommended to use at least this settings during development!
In final release you should set Debug=”” to disable debugging.
Error Prints errors (red , if something failed in grid – data communication, action, formula) and fatal errors (big red, TreeGrid cannot render)
Problem Prints warnings (brown, something is wrong in TreeGrid, but it may or may not have influence on running), errors and fatal errors
Info Prints status (black, something started, something finished, something called), timers (black, profiling information), warnings, errors and fatal errors
Check Checks all input XML attributes and prints all unknown attributes that are not used by TreeGrid
It is useful when upgrading to see unsupported attributes and also to find typing errors.
Remember, it can do false alarms if you use custom grid, row, col, cell attributes, you can define them in DebugCheckIgnore.
This option can remarkably slow down data loading in large grids!
IOError Lists input / output data from erroneous communication
IO Lists all input / output data. Sets *_Debug=”In,Out” for every data source that has not set its Debug attribute, except Defaults and Text.
Cookie Prints all information about grid configuration loaded from cookies.
Page Prints status information for downloading pages, cells (DefaultsServer), AutoUpdate
Event All mouse over events to see what part in grid is marked by what action event name. Useful for attaching events. Very talkative.
<treegrid,bdo> string[] xxx_Debug new 6.0.
Debugging settings for appropriate data source (e.g. Upload_Debug=”Out”)
A list of comma separated keywords specified what information will be printed to the Debug window. The keywords are case insensitive.
In Lists all input XML downloaded from server
Out Lists all output XML uploaded to server
Raw Lists all output XML directly as it is uploaded to server
<treegrid,bdo> string[] DebugCheckIgnore new 6.0.
Comma separated list of all attributes that Debug[“Check”] will ignore.
These attributes will be ignored for every tag except <treegrid> / <bdo>.
These attributes are also ignored for every cell.
<treegrid,bdo> string DebugTag new 6.0.
An id of existing tag on HTML page to print the debug information to.
If not set, default TreeGrid debug tag is created and used.
<treegrid,bdo> string DebugWindow new 6.1.
Name of new window to print debug list to another window instead of DebugTag.
<treegrid,bdo> bool AlertError new 6.0.
If set to 1 it alerts a message to user when communication with server failed.
API method void Debug (int type, string arg1, string arg2, string arg3, ...) new 6.1.
Prints information to the TreeGrid Debug window
type is 0 – fatal error, 1 – error, 2 – warning (shown when Debug contains Problem), 3 – list (shown always), 4 – info (shown when Debug contains Info).
The arg are strings to display, are shown without any separator, every even string is displayed bold.
API event bool OnDebug (int level, type[] arguments) new 9.0.
Called for every debug print, regardless on debug level, except input / output data.
Return true to suppress default action.
Can be used for redirecting the debug prints to another output.
level is debug level (importance), like type in Debug function.
arguments is array of the printed strings, the first item is also the level.
<Actions> DebugUndo Attached to OnCtrlAltD event new 7.0.
Prints to new window all actions done from last clearing undo. Prints only actions that can be undone.
It prints the actions as calling API methods, so the developer can easily redo the actions by simply adding the list to the script.
Works only when set <Cfg Undo=’1’/> and Debug contains “Error”.
It can be used when reporting bugs, to get the action list that led to incorrect behavior:
When you face some incorrect behavior during testing, press Ctrl+Alt+D to show the window.
Click to Test button to reload grid and to do automatically all the actions again.
If the problem rises again, it means it can be simulated by this action list.
Press again Ctrl+Alt+D and select and copy all the message text to clipboard and send it to developer with all the example data to simulate the bug.