Documentation

addSpan

adds colspan or rowspan to the datatable

void addSpan(number| string| object id ,string column ,number width ,number height , [string value ,string css ] );

Parameters

id number| string| objectid of the row that starts colspan/rowspan;
column stringid of the column that starts colspan/rowspan;
width numberhow many columns should the span include;
height numberhow many rows should the span include;
value stringvalue that the span area should display;
css stringcss class that should be applied to the span area.

See also

Available only in PRO Edition

Example

grid.addSpan(1, "country", 1, 3);

Details

The method can as well take an array of arrays with the same configuration (id, column, width, height, value, css) to define several spans at a time.

grid.addSpan([
    [1, "country", 1, 3],
    [4, "country", 1, 2],
    [6, "country", 1, 3]
]);

Defaults:

  • default values for span width and height are 1;
  • span value parameter is optional and used if a custom text for the cell is required. If you need to display the initial value, omit this field or pass an empty value ("", null);
  • span css is optional. By default, colspans and rowspans don't feature any special styling.
Back to top