|
<style>
.e-accordion .e-acrdn-item .e-acrdn-panel .e-grid .e-content{
padding:0px;
}
</style> |
|
import { Accordion } from '@syncfusion/ej2-navigations';
import { Grid } from '@syncfusion/ej2-grids';
import { Query, DataManager } from '@syncfusion/ej2-data';
import { orderData } from './datasource';
/**
* Grid in Accordion sample
*/
let acrdnObj: Accordion = new Accordion({ //Initialize Accordion component
items : [
{ header: 'Essential JavaScript 2 Grid1', expanded:true,content : '#Grid1'},
{ header: 'Essential JavaScript 2 Grid2', expanded:true,content : '#Grid2'}
]
});
acrdnObj.appendTo('#accordion');
let data: Object = new DataManager(orderData as JSON[]).executeLocal(new Query().take(15));
let grid: Grid = new Grid(
{
dataSource: orderData.slice(0,5),
columns: [
{ field: 'OrderID', headerText: 'Order ID', width: 120, textAlign: 'right' },
. . .
]
});
grid.appendTo('#Grid1');
let grid: Grid = new Grid(
{
dataSource: orderData.slice(0,5),
columns: [
{ field: 'OrderID', headerText: 'Order ID', width: 120, textAlign: 'right' },
. . .
});
grid.appendTo('#Grid2');
|
|
<!DOCTYPE html><html><head>
<meta charset="UTF-8">
<link rel='nofollow' href="http://cdn.syncfusion.com/ej2/ej2-base/styles/material.css" rel="stylesheet" />
<link rel='nofollow' href="http://cdn.syncfusion.com/ej2/ej2-navigations/styles/material.css" rel="stylesheet" />
<link rel='nofollow' href="http://cdn.syncfusion.com/ej2/ej2-grids/styles/material.css" rel="stylesheet" />
. . .
. . .
</head>
<body>
<div class="control-section">
<div class="content-wrapper">
<div id="accordion">
</div>
<div id="Grid" style="display:none">
</div>
<div id="Grid2" style="display:none">
</div>
</div>
</div>
</body>
</html> |
|
import { Accordion } from '@syncfusion/ej2-navigations';
import { Grid, Filter, ColumnMenu, Page } from '@syncfusion/ej2-grids';
import { orderData } from './datasource';
Grid.Inject( Filter, ColumnMenu, Page);
/**
* Grid in Accordion sample
*/
let acrdnObj: Accordion = new Accordion({ //Initialize Accordion component
items: [
{ header: 'Essential JavaScript 2 Grid', expanded: true, content: '#Grid' }
]
});
acrdnObj.appendTo('#accordion');
let grid: Grid = new Grid({
dataSource: orderData,
allowPaging:true,
allowFiltering: true,
filterSettings: { type: checkbox },
showColumnMenu: true,
columns: [
{ field: 'OrderID', headerText: 'Order ID', width: 200, textAlign: 'right' },
. . .
]
});
grid.appendTo('#Grid');
|