PDA

View Full Version : Checkcolumn error when adding events



lenraff
11 Nov 2019, 3:37 AM
I'm trying to configure a grid with a checkbox (checkcolumn):


<grid #item [store]="store" [height]="180" [plugins]="{grideditable: true}" [itemConfig]="{viewModel: {}}">
<checkcolumn #item text="Provided" dataIndex="provided" width="150" [onCheckChange]="gridCheckboxChange"></checkcolumn>
</grid>

This is giving me an error:


Uncaught Error: Template parse errors:Binding to event property 'onCheckChange' is disallowed for security reasons, please use (CheckChange)=...If 'onCheckChange' is a directive input, make sure the directive is imported by the current module. ("e="true"></column>

I cannot add any listeners to this checkbox which is currently in the grid. How do I add a listener to this checkcolumn? https://docs.sencha.com/extangular/6.7.0/modern/Ext.grid.column.Check.html#event-onCheckChange

lenraff
12 Nov 2019, 7:34 AM
I had to use the listeners property rather than binding to the event directly. This works:


<checkcolumn #item text="Provided" dataIndex="provided" width="150" onchange="gridCheckboxChange"
[listeners]="{checkChange:onProvidedCheckChange}"></checkcolumn>