beautypg.com

MiG InfoCom MiG Calendar Getting Started Guide User Manual

Page 23

background image

MiG InfoCom AB

Filter Rows and Categories
Every column/row in the grid can be divided into sub rows.

These sub rows can be divided further into sub rows so it is

basically hierarchical. These sub rows are usually filtered in

some way to only show a certain kind of activities so they

appear separate from each other. This is for instance how the

TV-schedule is done in the demo application.
You can write your own filter code to filter on whatever, but

normally Categories are used as filters. Since categories are

also hierarchical it is quite easy to map a category tree, or

part there of, to sub rows.
The simplest way to do this is to set

CategoryFilter

s on

the

DefaultDateArea

. The creator class that creates the

DateGrid

will pick this up and create sub rows

automatically. You can also exchange the date grid creator

itself to create the rows as you want but that is an advanced

approach.
Below is a code snippet that shows how to set up three sub

rows rows in every main row in the grid.

// (id, name, parentID)
Category mark = new Category(new Integer(0), "Mark", null);
Category susan = new Category(new Integer(1), "Susan", null);
Category michael = new Category(new Integer(2), "Michael", null);

// (category, includeSubCategories, acceptUncategorized)
CategoryFilter[] peopleFilter = new CategoryFilter[] {

MiG Calendar Getting Started Guide

Page 23 / 31

Illustration 13 Visually rounded to day