Issue T11803
Visible to All Users

onMatrixAllowRemoveRow does not work.

created 2 years ago

In matrixdynamic "allowRemoveRows" set to true . When page is loading I check if Id is populated (this record could not be removed)
But when user adds new row he should be able to remove it, until it is not saved. But remove button doesn't appear.
Initially all records should have Remove button as hidden, perhaps this is the issue, column for it not created at all?

TypeScript
survey.onMatrixAllowRemoveRow.add(function(sender, options) { options.allow = !options.row.getValue("dbid_Cpr"); console.log(options, options.row.getValue("dbid_Cpr")) ; });
Code
{question: t, rowIndex: 6, row: t, allow: false} 'd25d53ad-7c57-452b-a571-76d2db3f3cfa' <=== existing {question: t, rowIndex: 8, row: t, allow: true} null <=== new
Comments (1)

    Hello Denis,
    Thank you for reporting this issue. I forwarded it to our developers for further research: Dynamic Matrix - The Remove row button doesn't appear when enabling the options.allow in the onMatrixAllowRemoveRow event handler. Please stay tuned.

    Answers approved by surveyjs Support

    created 2 years ago

    Hello Denis,
    The issue has been fixed. Here is the related GitHub issue and PR. It should be merged soon, after all checked will be passed.
    The fix will be available in the next version that we will release next week.

    Thank you,
    Andrew
    SurveyJS Team