issue from @Kichi93 https://github.com/surveyjs/surveyjs/issues/384
I've found an issue with my application where I'm trying to use a custom widget within a dynamic matrix. It seems to also exist in the plunk mentioned above (plunk) so thought you might be able to offer some advice.
If you have multiple rows in the dynamic matrix and then click the remove button on the first row the last row gets removed. Other rows will do the same, always removing the last row. Interestingly, the correct element in the dynamic matrix data array is removed i.e. the data is correct but the display is wrong.
I've seen this issue in IE and Firefox. Any help would be greatly appreciated.
steps to reproduce
I'm facing the same issue while using select2 widget (https://www.surveyjs.io/Examples/Library/?id=custom-widget-select2) with matrix dynamic. Reproduced in Chrome as well.
Please note, that the correct row is being removed from the model, so at the end there is a difference between rendered and model state.
@nikitakarpenkov, so it is not a bug with library, but not complete custom widget realization. We need to tell to the widget about row removing. So we need add this code in afterRenderMethod:
question.survey.onMatrixRowRemoved.add(function(survey, options) {
question.customWidgetData.isNeedRender = true;
})
and I've update the exmple above and created new simple example:
updated example: http://plnkr.co/edit/7s73Ll?p=preview
simple example: http://plnkr.co/edit/JAxG4t?p=preview
PS: we are working on _custom widgets_ system and after the 1.0.0 release we could just import custom widget from a collection and just use it as regular question.
Most helpful comment
steps to reproduce