var data1 = {
items : <brp:json value="${display1}"/>,
identifier : "id"
};
var store = new dojo.data.ItemFileReadStore({
data : data1
});
var layout = [ {
field : 'id',
name : 'Column1',
width : '150px'
},{
field : 'Column2',
name : 'Column2',
width : '200px'
},{
field : 'Column3',
name : 'Column3',
width : '490px'
} ];
var grid = new dojox.grid.EnhancedGrid({
id : 'grid',
query : {
id : '*'
},
store : store,
clientSort : false,
rowSelector : '20px',
plugins: {indirectSelection: {headerSelector:true, width:"40px", styles:"text-align: center;"}},
height : "380px",
structure : layout,
}, document.createElement('div'));
dojo.byId("div1").appendChild(grid.domNode);
var data2 = {
items : <brp:json value="${display1}"/>,
identifier : "id"
};
var store2 = new dojo.data.ItemFileReadStore({
data : data2
});
var Structure2 = [ {
field : 'id',
name : 'Column1',
width : '150px'
},{
field : 'Column2',
name : 'Column2',
width : '200px'
},{
field : 'Column3',
name : 'Column3',
width : '490px'
} ];
var grid2 = new dojox.grid.EnhancedGrid({
id : 'grid2',
query : {
id : '*'
},
store : store2,
clientSort : false,
rowSelector : '20px',
plugins: {indirectSelection: {headerSelector:true, width:"40px", styles:"text-align: center;"}},
height : "380px",
structure : Structure2,
}, document.createElement('div'));
dojo.byId("div2").appendChild(grid2.domNode);
grid.startup();
grid2.startup();
You have to do one more thing - Inside div where you want to display the div put with height
Notes -
grid.startup();
--> indicate starting of your div
where grid is your specified grid
div1 and div2 ---> your div-id
plugins:
{indirectSelection: {headerSelector:true, width:"40px", styles:"text-align: center;"}}
-->is for check boxes for your grid data's
Like this we can populate no. of grid using dojo.