question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there any way to bypass minRowCount validation when the question is not mandatory in matrixdynamic?

See original GitHub issue

Hi,

Is there any way to bypass minRowCount validation when the question is not mandatory in matrixdynamic?

{
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "matrixdynamic",
     "name": "question1",
     "columns": [
      {
       "name": "Column 1"
      },
      {
       "name": "Column 2"
      },
      {
       "name": "Column 3"
      }
     ],
     "choices": [
      1,
      2,
      3,
      4,
      5
     ],
     "isRequired": false,
     "rowCount": 1,
     "minRowCount": 1,
     "maxRowCount": 5
    }
   ]
  }
 ]
}

For above json, My client wants to hide the Remove button when the rowCount: 1. I found minRowCount: 1 can do the trick, but it still prompt an error message when I validate the form.

Thanks.

  • browser: Chrome
  • browser version: 79.0.3945.79
  • surveyjs platform (angular or react or jquery or knockout or vue): React
  • surveyjs version: 1.1.25

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewtelnovcommented, Dec 27, 2019

@KLC215 Sorry, for misunderstanding. Finally I can see the issue. Got it. You can use survey.onSettingQuestionErrors event to modify question errors. Here is the code

survey.onSettingQuestionErrors.add(function(sender, options) {
    for (var i = options.errors.length - 1; i >= 0; i--) {
        if (options.errors[i].getErrorType() === 'minrowcounterror') {
            options.errors.splice(i, 1);
        }
    }
});

And here is the example.

Thank you, Andrew

0reactions
KLC215commented, Dec 27, 2019

@andrewtelnov No, it’s my poor explanations. Thanks for saving my life~~~~~It works well 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

[SOLVED] cant get past thru Mi account verification
Sign in Xiaomi/Mi account, go to /Signing in and Security/Manage Devices/Your device, then click on it, and Delete device, you will sign in...
Read more >
HOW TO BYPASS XIAOMI MI ACCOUNT WITHOUT PC 2022
In this video, I will show you a cool trick on how to get your XIAOMI device back and running if it has...
Read more >
How to Bypass Xiaomi Mi Account Lock on Any Xiaomi Phone
How to Bypass Xiaomi Mi Account Lock on Any Xiaomi PhoneFastboot Flash File https://goo.gl/KHB5iNMiFlash Tool https://goo.gl/lzug0eSubscribe ...
Read more >
How to Bypass Google Verification in XIAOMI Redmi 8
If you are looking for a way to activate your Xiaomi smartphone ... and skip FRP in a few easy steps and login...
Read more >
Enable "Install via USB" without creating MI Account
So, I have 3 questions: Why did they make it neccessary to provide an account for enabling an option like this? Is there...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found