<div id="defaultDialog">
TreeGrid.Inject(Page);
let treegrid: TreeGrid = new TreeGrid(
{
dataSource: sampleData,
childMapping: 'subtasks',
treeColumnIndex: 1,
allowPaging: true,
height: 500,
columns: [
{ field: 'taskID', headerText: 'Task ID', width: 70, textAlign: 'Right' },
{ field: 'taskName', headerText: 'Task Name', width: 200, textAlign: 'Left' },
]
});
let dialogObj: Dialog = new Dialog({
header: 'About SYNCFUSION Tree grid inside Dialog',
target: document.getElementById('target'),
content: "<div id='TreeGrid'></div>",
animationSettings: { effect: 'None' },
showCloseIcon: true,
width: '800px',
height: '600px',
open: dialogOpen,
});
dialogObj.appendTo('#defaultDialog');
// 'Open' Button will be hidden, if Dialog is opened
function dialogOpen(): void {
//document.getElementById('dialogBtn').style.display = 'none';
treegrid.appendTo('#TreeGrid');
} |