Developers
   Introduction to Brainwave
   Developer's Cheat Sheet
   Grid User Manual
   API Reference Guide
   Brainwave Forum
   Downloads
  Developer Support
   FAQ
   Bug Reporting
   Feature Requests
   Tech Support
  Applications
   Getting Started
   Example Applications
   Application Framework
   Idea Framework
   Iris
   Aphrodite
   Poseidon
   Cerberus

Download Free SDK

Brainwave Academy


 Home
>> Developers >> Grid User Manual

Grid User Manual

Grid Widget Version 1.0

The grid widget is a feature rich tool that allows to do data analysis. The data from the back end can be fetched and displayed in the grid widget.

Following features are available in this version:

Attributes of Grid widget:

Sample Code:

<gridbox id='my_grid' total='10' />

Example:

Analytics Framework:

If you want to display data from the backend and do analysis on it, then the data needs to be passed to the analytics framework. This framework then processes the data and creates a format which can be passed to the grid widget (which is also a part of the framework) for displaying that data in the browser. The analytics framework is there in the apps folder inside the brainwave folder.

gid = iris.root.analytics.grid.createGrid(dat)

This line of code will send the data to the analytics framework, which will process and format the data and return an id of the grid. The id is then passed to the cheetah template file (see the template code below) along with the length of the data (which is a list of dictionary in this case) to the grid template which will take this data and render it for displaying.

Note: To know more about python you need to consult the tutorials available online at http://docs.python.org/tut/ and to know more about coding in brainwave consult the tutorials at http://www.brainwavelive.com/developers/

The template file code for the above example will be the following:

<window>
   <box>
     <div style="text-align:left;">
       <gridbox id='$grid_id' total='$grid_length' />
     </div>
   </box>
</window>

The above code contains the template for the grid widget, which will display the grid. The template will accept the id and the length of the data passed from the python code and then displays the data in the browser.

The analytics framework also supports the use of "Idea" (to know more about it refer the Idea database framework at http://www.brainwavelive.com/developers/ideaframework.html ) which contains several APIs for putting and fetching data to and from the database. Thus, the Idea object can be directly passed to the grid to display data from the backend database.