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.

Trigger from MatrixDynamic to setValue in the same MatrixDynamic

See original GitHub issue

Hello, we are facing a problem trying to manage a trigger event inside a MatrixDynamic.

What is the current behavior?

Currently, on changing the field in MatrixDynamic, we have a trigger who have the responsavilitie to sett the other fields from the same MatrixDynamic (the same row). The fact is, the trigger works as expected, and capture the runexpression trigger, but the setValue() dosen’t fill target fields.

What is the expected behavior?

The expected behavior should update the other fields from a fieldName dynamicMatrix trigger

// products is the DynamicMatrix name
// This code is executed insed the same dynamicMatrix trigger

surveyModel.setValue('products', [
       {productName:'prod 01'} // thats just  a test, it dosen't update anything
]);

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
andrewtelnovcommented, Mar 12, 2020

@VGamezz19 I am afraid it is not possible to do it via trigger mechanism right now. If you host SurveyJS Library on your own page, then you can handle survey.onMatrixCellValueChanged event and do what you need. I did not check the code, but it should work

survey.onMatrixCellValueChanged.add(function(sender, options) {
  if(options.question.name != "yourMatrixQuestionName") return;
  if(options.columnName != "yourCopyFromColumnName") return;
  options.getCellQuestion("yourCopyToColumnName").value = options.value;
});

Thank you, Andrew

0reactions
VGamezz19commented, Mar 17, 2020

@andrewtelnov we got it! we manage the dropdown load inside the trigger method of the onMatrixCellValueChanged by isChoiseLoaded

    if (!options.getCellQuestion(options.columnName).isChoicesLoaded) {
      return;
    }

thanks you so much for your time, i’ll close issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Triggers & set value/ run expressions on dynamic panels
Hello Team,. I wan to run a trigger to set value of a field in dynamic panel based on value of another question...
Read more >
Set Value Trigger, Angular Survey Library Example
Show/Hide rows in matrix dropdown question · EnableIf · Complete Trigger · CopyValue Trigger · SetValue Trigger · Run Expression Trigger. Text Formatting....
Read more >
Bootstrap-slider.js are not trigger the setValue change ...
I'm using bootstrap-slider.js . Everything works fine, but setting a new value with setValue does not trigger the "change" function.
Read more >
survey-react | Yarn - Package Manager
Clear setValue for setvalue trigger can produce exception #3145 (e2efee1) · Do not call notification on setting the same value in select base...
Read more >
survey-knockout/survey.ko.d.ts
* A function that is called when an [ItemValue](https://surveyjs.io/Documentation/Library?id=itemvalue) property is changed. 638, *.
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