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.

MatrixDynamic maxRowCount not changing if decreasing

See original GitHub issue

Are you requesting a feature, reporting a bug or ask a question?

bug

What is the current behavior?

When decreasing maxRowCount on MatrixDynamic, property on MatrixDynamic did not change. If increasing the value it’s ok.

What is the expected behavior?

maxRowCount property always set to provided value

How would you reproduce the current behavior (if this is a bug)?

Set value of rowCount/minRowCount/maxRowCount from the text field. Input 3, set the properties rowCount/minRowCount/maxRowCount on matrixdynamic. Input 1, set the properties rowCount/minRowCount/maxRowCount on matrixdynamic.

1 row displayed (rowCount), minRowCount is 1, but it’s possible to add 2 more rows (maxRowCount still is 3).

Provide the test code and the tested page URL (if applicable)

Tested page URL: https://plnkr.co/edit/SU3l9zVuNfAJ8hnOcqSn?p=preview

Test code

survey
    .onValueChanged
    .add(function (survey, options) {
    
    var numberRows = parseInt(options.value)
    if (numberRows) {
      var question = survey.getQuestionByName('teachersRate')
      question.rowCount = numberRows
      question.maxRowCount = numberRows
      question.minRowCount = numberRows
      
      console.log(question.maxRowCount)
    }
      
})

Specify your

  • browser:
  • browser version:
  • surveyjs platform (angular or react or jquery or knockout or vue):
  • surveyjs version:

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
andrewtelnovcommented, Jul 5, 2018

@snay We have rewritten this. Now you can set question.maxRowCount/minRowCount without if statement.

question.minRowCount = numberRows;
question.maxRowCount = numberRows;

Thank you, Andrew

0reactions
snaycommented, Mar 6, 2018

Tricky, but works for my case, thanks a lot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MatrixDynamic maxRowCount not changing if decreasing #973
When decreasing maxRowCount on MatrixDynamic, property on MatrixDynamic did not change. If increasing the value it's ok. What is the expec.
Read more >
QuestionMatrixDynamicModel - SurveyJS
maxRowCount property. A maximum number of rows in the matrix. Users cannot add new rows if rowCount equals maxRowCount . Default value: 1000...
Read more >
how to use matrixdynamic with nouislider in angular9
I have kind of matrixdynamic table but how can i use inside slider or nouislider instead of the radio button? and how can...
Read more >
Use options to customize the Survey Editor, Survey Builder ...
triggerNotSet:"The trigger is not set",triggerRunIf:"Run if",triggerSetToName:"Change value of: ",triggerFromName:"Copy value from: " ...
Read more >
change text of rows in type matrix surveyjs - Stack Overflow
You can add matrix rows dynamically: var json = { questions: [ { type: "matrix", name: "score", title: "Please score the employees in...
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