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.

JSON result incorrect

See original GitHub issue

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

Bug

What is the current behavior?

Final JSON results contains wrong answers.

{
    "q1": "6",
    "q2": {
        "Row1": "Column1",
        "Row2": "Column1",
        "Row3": "Column3",
        "Row4": "Column3",
        "Row5": "Column3",
        "Row6": "Column3"
    },
    "q3": "q7item2",
    "q4": [
        "other",
        "q4item1",
        "q4item2",
        "q4item3",
        "q7item3"
    ],
    "q4-Comment": "Other 1",
    "q7": [
        "other",
        "q7item3",
        "q7item2",
        "q7item1",
        "q9item3"
    ],
    "q7-Comment": "Other",
    "q8": "other",
    "q9": "q9item3",
    "q8-Comment": "other 3"
}

In above results Q4 contains Q7 answer and Q7 contains Q9 answer.

What is the expected behavior?

Final output should be

{
    "q1": "6",
    "q2": {
        "Row1": "Column1",
        "Row2": "Column1",
        "Row3": "Column3",
        "Row4": "Column3",
        "Row5": "Column3",
        "Row6": "Column3"
    },
    "q3": "q7item2",
    "q4": [
        "other",
        "q4item1",
        "q4item2",
        "q4item3",
    ],
    "q4-Comment": "Other 1",
    "q7": [
        "other",
        "q7item3",
        "q7item2",
        "q7item1",
    ],
    "q7-Comment": "Other",
    "q8": "other",
    "q9": "q9item3",
    "q8-Comment": "other 3"
}

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

Just navigate in the below demo and check the final result with the actual selected answers.

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

Tested page URL: Demo

Specify your

  • browser: Google Chrome
  • browser version: Version 59.0.3071.115 (Official Build) (64-bit)
  • surveyjs platform (angular or react or jquery or knockout or vue): jQuery
  • surveyjs version: 0.12.19

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
dmitrykurmanovcommented, Oct 2, 2017

@nithinM, hello! This is the bug in our examples, we should add willUnmount method in it. Like in this example: https://surveyjs.io/Examples/Library/?id=custom-widget-icheck&platform=jQuery

var widget = {
    name: "icheck",
    isFit : function(question) { return question["renderAs"] === 'icheck'; },
    isDefaultRender: true,
    afterRender: function(question, el) { ... },
    willUnmount: function(question, el) {
        var $el = $(el);
        $el.find('input').iCheck('destroy');
    }
}

I’ve updated your plnkr: https://plnkr.co/edit/NWOJvBIVxqnva7NfXpKO?p=preview, could you check it please?

In fact we are working on version 1.0. And you could just import widget and use it. So same bugs will abandone.

0reactions
nithinMcommented, Oct 3, 2017

Hi, @dmitrykurmanov ! Yeah perfect it’s working now. Thank you so much for get back with the solution for this. Cool so waiting for the new release!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Json result displayed wrong value when shown
The value of the "no" property is returned wrongly as 35797506102858584 when json result displayed. Ex:https://jsoneditoronline.org/?id= ...
Read more >
How to Fix the Invalid JSON Error in WordPress?
How To Fix 'Updating Failed. The Response is Not a Valid JSON Response' Error · Check the URL Settings of the WordPress Site...
Read more >
I've received an "Invalid JSON string" error. What do I do?
An invalid JSON error can occur for many reasons. The most common issue is usually associated with a file upload attempt, and can...
Read more >
How to Fix The Invalid JSON Error in WordPress ...
How to Fix The Invalid JSON Error in WordPress (Beginner's Guide) · 1. Check WordPress URLs in Settings · 2. Fix WordPress Permalink...
Read more >
1. Warning: Invalid JSON response
A warning from DataTables stating "Invalid JSON response" is one of the most common errors that can occur with DataTables. Fortunately it is...
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