I have ag-grid table. I am replacing 'Bookingxml' column data with button. When that button is clicked, it should show the data of that particular cell in 'out' div. I went through the documentation and figured, cellRenderer is the way to do it. I tried below code, but that didn't work.
var gridOptions = {
columnDefs: [
{headerName: 'Booking Type', field: 'BookingType', width: 200},
{headerName: 'Booking Error', field: 'BookingError', width: 150 },
{headerName: 'Booking Date', field: 'BookingDate', width: 150, filter: 'number', filterParams: {apply: true, newRowsAction: 'keep'}},
{
headerName: 'Booking XML', field: 'Bookingxml', width: 250,
cellRenderer: function (params) {
return '<button ng-click="display()">View XML</button>';
}
}
],
enableColResize: true,
enableSorting: true,
enableFilter: true
};
return gridOptions;
}
function display(xml) {
$('#out').html(params.value);
}