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.

indexing and logic inside a dynamic panel

See original GitHub issue

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

Questions I’m using a dynamic panel with 3 widgets inside. I want the user to fill these widgets one by one in a fixed order so I want to hide them first. As each tab is independent, I need to retrieve the tab index each time.

How can I get the current panel tab index to write the logic? Can this be done directly in the survey editor? Can we also add some logic to the “add new” button so it is disabled until we ask all questions in the current tab?

Example: {mypanel[currentIndex].question1} notempty -> mypanel[currentIndex].question2 visible

What is the current behavior?

What is the expected behavior?

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

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

Tested page URL:

Test code

your_code_here

Specify your

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

Thanks

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
tam-carrecommented, Feb 2, 2022

For anyone stuck on this issue, I was struggling for a while because of an ambiguity in @andrewtelnov linked example:

var json = {
   "textUpdateMode": "onTyping",
 "pages": [
  {
   "name": "page1",
   "elements": [
    {
     "type": "paneldynamic",
     "name": "panel",
     "panelCount": 1,
     "templateElements": [
      {
       "type": "text",
       "name": "question1"
      },
      {
       "type": "text",
       "name": "question2",
       "visibleIf": "{panel.question1} notempty"
      },
      {
       "type": "text",
       "name": "question3",
       "visibleIf": "{panel.question1} notempty and {panel.question2} notempty"
      }
     ]
    }
   ]
  }
 ]
};

Because the dynamic panel happens to be named "panel", it looks like the logic must be written as {${panelName}.${questionName}}, when in fact panel is a keyword in the logic expression for the current dynamic panel's instance. In other words, even if your dynamic panel is named opinions, the logic will be panel.question1 and not opinions.question1.

0reactions
tkon3commented, Mar 1, 2020

Perfect this is what I was looking for.

Thank you.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conditional Logic and Dynamic Texts | SurveyJS
Conditional Logic and Dynamic Texts. This help topic describes how to implement custom conditional logic and add dynamic texts to your survey.
Read more >
add inputs in dashboards explained - YouTube
In this Splunk tutorial, we have created a step by step guide for ... Advanced dashboards with dynamic and editable inputs in Splunk...
Read more >
Flex Indexes | Couchbase Docs
The Flex Index feature enables you run a N1QL query as a full-text search query, using a full-text index. This means that you...
Read more >
Panel data econometrics in R: - R Project
In the panel data field as well as in others, the econometric approach is ... Two further arguments are logical: drop.index = TRUE...
Read more >
When using Dynamic View logic, is it not possible to hide ...
I have quite a number of columns and I don't want all of them displayed in the panel until a trigger is reached...
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