private showSearchEvents(type: string, data?: Object): void {
if (type === 'show') {
if (document.getElementById('grid').classList.contains('e-grid')) {
let gridObj: Grid = (document.querySelector('#grid') as EJ2Instance).ej2_instances[0] as Grid;
gridObj.dataSource = data;
gridObj.dataBind();
} else {
let gridObj: Grid = new Grid({
dataSource: data,
height: 505,
width: 'auto',
columns: [
{ field: 'produktname', headerText: 'produktname', width: 120 },
{ field: 'ort', headerText: 'ort', width: 120 },
{ field: 'datum_von', headerText: 'datum_von', width: 120, format: { type: 'dateTime', format: 'dd.MM.yyyy HH:mm ' } },
],
rowSelected: rowSelected
});
gridObj.appendTo(document.querySelector('#grid') as HTMLElement);
this.scheduleObj.element.style.display = 'none';
function rowSelected(args){
console.log('selected row: ', args)
}
}
} else {
let gridObj: Object[] = (document.querySelector('#grid') as EJ2Instance).ej2_instances;
if (gridObj && gridObj.length > 0 && !(gridObj[0] as Grid).isDestroyed) {
(gridObj[0] as Grid).destroy();
}
this.scheduleObj.element.style.display = 'block';
}
}
html file div:<div id="grid"></div>
here inside the rowSelected Function, I would like to call another function on my ts file. It send me "is not a function" error.
On click of row i would like to open bootstrap modal with all information about the specific clicked row.
Can anybody please help me with my problem or requirement.
Regards, Parth|
let gridObj: Grid = new Grid({
dataSource: data,
height: 505,
width: 'auto',
columns: [
{ field: 'Subject', headerText: 'Subject', width: 120 },
{ field: 'Location', headerText: 'Location', width: 120 },
{ field: 'StartTime', headerText: 'StartTime', width: 120, format: { type: 'dateTime', format: 'M/d/y hh:mm a' } },
{ field: 'EndTime', headerText: 'EndTime', width: 120, format: { type: 'dateTime', format: 'M/d/y hh:mm a' } },
],
rowSelected: this.rowSelected.bind(this)
});
gridObj.appendTo(document.querySelector('#grid') as HTMLElement); |