Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Custom grid widgets are mainly created through the use of Cascading Style Sheets (CSS).  By assigning a custom CSS class to the widget and by using some built-in classes already provided by the grid, we are able to control the look and feel of the grid in great detail.

The built-in classes of a grid widget include:

  • cell – assigned to each grid cell in the body of the grid
  • header-cell – assigned to each in the grid heading
  • odd – assigned to cells within odd rows
  • even – assigned to cell within even rows
  • selected – assigned to rows that are selected when the “row selection” property is used
  • hover – assigned to rows when the mouse is hovering over them allowing you to specify a hover effect

You will also want to come up with a custom class for the grid.  In this example, we will use the class name custom-grid.  CSS nesting will allow us to combine the usage of this custom name with the built-in classes already provided by the grid.

To begin, create a new CSS file and place it in directory /www/profoundui/htdocs/profoundui/userdata/custom/css.  You can start with the following base CSS and keep tweaking it from there:

/* provide default z index value for the grid */

.custom-grid

Unknown macro: {   z-index}


/* provide default font and alignment for the cells */

.custom-grid .cell

Unknown macro: {   font-family}


/* provide default font, background, etc. for the header */

.custom-grid .header-cell

Unknown macro: {   font-family}

.custom-grid .header-cell div

Unknown macro: {   text-align}


/* color for for odd, even rows */

.custom-grid .odd

Unknown macro: {   color}

.custom-grid .even

Unknown macro: {   color}

/* protected input fields specified separately */

.custom-grid .odd INPUT.PR

Unknown macro: {   color}

.custom-grid .odd INPUT.PR-UL

Unknown macro: {   color}

.custom-grid .even INPUT.PR

Unknown macro: {   color}

.custom-grid .even INPUT.PR-UL

Unknown macro: {   color}


/* colors for selection and hover effects */

.custom-grid .selected

Unknown macro: {   color}

.custom-grid .hover

Unknown macro: {   color}




Finally, build the custom widget and place it in the designer’s toolbox by creating a JavaScript file and placing it in directory /www/profoundui/htdocs/profoundui/userdata/custom/widgets.

pui.toolbox.add(

Unknown macro: {   category}

);

Note the default “css class” property is what will make the grid appear according to our style sheet rules.

  • No labels