Jsgrid Javascript Grid Framework

addstyle method

The method addstyle creates a grid cell in the position where the grid was removed or not created before. The position status can be identified with the method grid. If a grid exists in the position, there will be no grid cell created.

Syntax

objgrid.addgrid(array elements,object style)

Parameters

elements - Single grid cell object or array of grid cells.

style - Json format style properties.

Example

var pggrid = new jsgrid(); 
        pggrid.init({ 
        id:"wrp", 
        rows:5, 
        columns:12, 
        width:25, 
        height:20, 
        gutter:1,
        backgroundColor: "#7fffd4" 
        });
     
var grp2 = pggrid.grid([2,3]); 
grp2.innerHTML = "2,3";

var grp3 = pggrid.grid([3,2]); 
grp3.innerHTML = "3,2";

pggrid.addstyle([grp2,grp3],{backgroundColor:"#ddcc00"}); 

Grid View