Closed zsnmwy closed 1 year ago
I tried to follow the document and create a button in AgGrid. But failed. The button did not appear as expected.
The function is serialized on return. That's my guess.
class BtnCellRenderer { constructor() {} init(params) { this.params = params; this.eGui = document.createElement('button'); this.eGui.innerHTML = 'Push me!'; this.btnClickedHandler = this.btnClickedHandler.bind(this); this.eGui.addEventListener('click', this.btnClickedHandler); } getGui() { return this.eGui; } destroy() { this.eGui.removeEventListener('click', this.btnClickedHandler); } } BtnCellRenderer.prototype.btnClickedHandler = function () { if (!state.logs) { state.logs = []; } state.logs.push({ rowDataAfterChange: JSON.stringify(this.params.data) }); };
return [ { field: 'name' }, { field: 'age' }, { headerName: 'Send row data to state', cellRenderer: BtnCellRenderer } ];
5. Linke the output to the AgGid defs. <img width="1386" alt="image" src="https://github.com/windmill-labs/windmill/assets/35299017/bc51dd8e-145c-4a2c-a9a6-32eb14c77e9f"> ### Expected behavior The button should be displayed. Like: <img width="847" alt="image" src="https://github.com/windmill-labs/windmill/assets/35299017/a4b4f6e8-3847-4516-9c41-9d7824d9694a"> https://www.ag-grid.com/javascript-data-grid/component-cell-renderer/#simple-cell-renderer-example ### Screenshots _No response_ ### Browser information Chrome 113.0.5672.126 ### Application version Windmill CE v1.104.2 ### Additional Context _No response_
This worked fine on a self hosted instant with version v1.101.0-12-g94be4a8a.
Can confirm that this bug is fixed now @rubenfiszel
Describe the bug
I tried to follow the document and create a button in AgGrid. But failed. The button did not appear as expected.
The function is serialized on return. That's my guess.
To reproduce
return [ { field: 'name' }, { field: 'age' }, { headerName: 'Send row data to state', cellRenderer: BtnCellRenderer } ];