Hi,
I'm using a column template to conditionally show some buttons to the user.
The 2 issues I have:
1. How to call a function on my angular2 component, passing in a value from that row?
Currently I have found a way, involving hidden input elements, but I'm sure there must be a more elegant way to handle this.
2. When I click one of the buttons, it updates a boolean property of the object behind that row, but the column template isn't updated accordingly.
Attached you can find a sample I've created starting from https://github.com/IgniteUI/igniteui-angular2/tree/master/samples/igGrid.
Steps to reproduce:
1. click the Add' button
2. click "Publish" or "Unpublish" on one of the records
Thanks in advance for your answer.
Hello Maarten,
Thank you for contacting Infragistics!
The reason template is not changing is because the grid is not re-rendering the way you are changing the value. You can cause a re-render by calling “dataBind” in your functions/methdos:
http://www.igniteui.com/help/api/2016.2/ui.iggrid#methods:dataBind
Hi Mike,
Already tried that.
You can see that 'Publish' now becomes 'Unpublish' for very little time.
Afterwards it does fall back to 'true', just like in the first sample.
Attached you can find my changes.
Thanks for your help!
Maarten