SMART datagrid v.1 > Concepts

Back  Forward

Concepts.Fill and Stroke

1. Fill

Fill information used when draw the background of the data cell. It is internally stored as Fill object. 

1.1  Solid Brush

Specify the fill of a single color with the color value of string or an integer. Please refer to Colors page about how to specify the color value. 

Code -1
    column.setStyles({
        background: '#ff0000',
        color: '#ff00ff00'
    });
1.2  Linear Gradient

Specify linear gradient fill with two colors. 

Code -2
    column.setStyles({
        // The last '90' is the direction of gradient.
        background: 'linear,#ffffff,#f0f0f0,90'
    });
2. Stroke

Stroke information used when draw the data cell border. It is internally stored as Stroke object. 

If it is the case to specify as string when only allowed to draw a single color stroke, 

you can specify in the way of "Color, Stroke thickness, Dash." 

If do not specify Stroke Thickness, it will be drawn as 1 pixel, and if do not specify Dash, it will be drawn as Continuous Line. Dash can specify "dashed" or "dotted"

Code -3
    colum.setStyles({
        borderLeft: '#ff0000',
        // 2 pixel line
        borderLeft: '#00ff0,2px',   
        // dashed line
        borderBottom: "#aaa,1px,dashed"
    });
    column.styles().setShapeBorder(0xff00ff00);
See Also
Fill
Stroke
Colors Overview
Examples
Column Styles
Column Dynamic Styles