Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Survey Editor 1.0.58 does not render Select2 and Tagbox custom widgets #1456

Closed
willgdjones opened this issue Dec 1, 2018 · 22 comments
Closed

Comments

@willgdjones
Copy link

willgdjones commented Dec 1, 2018

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

Reporting a bug

What is the current behavior?

Survey Js Editor does not render Select2 or Tagbox widgets:

When I enter the JSON from the tagbox example into the Survey JS editor (v1.0.58),

{
  "pages": [
    {
     "name": "page1",
      "elements": [
        {
          "type": "dropdown",
          "renderAs": "select2",
          "choicesByUrl": {
            "url": "https://restcountries.eu/rest/v2/all"
          },
          "name": "countries",
          "title": "Please select the country you have arrived from:"
        }
      ]
    }
  ]
}

I receive the error:

Error: The property 'renderAs' in class 'dropdown' is unknown. The list of available properties are: name, visible, useDisplayValuesInTitle, visibleIf, width, startWithNewLine, indent, page, title, description, commentText, valueName, enableIf, defaultValue, correctAnswer, isRequired, requiredErrorText, readOnly, validators, titleLocation, hasComment, hasOther, choices, choicesOrder, choicesByUrl, hideIfChoicesEmpty, choicesVisibleIf, choicesEnableIf, otherText, otherErrorText, storeOthersAsComment, optionsCaption.

What is the expected behavior?

It should render the Select2 and Tagbox widgets.

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

Open the SurveyJS editor and enter the JSON

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

Hard to do unfortunately.

Specify your

  • browser: Chrome
  • browser version: Version 70.0.3538.110
  • surveyjs platform (angular or react or jquery or knockout or vue): Vue
  • surveyjs version: 1.0.58
@andrewtelnov
Copy link
Member

andrewtelnov commented Dec 1, 2018

@willgdjones Yes, it stops to work with service.
"choicesByUrl": { "url": "https://restcountries.eu/rest/v2/all" }
We will take a look.

Thank you,
Andrew

@willgdjones
Copy link
Author

Thanks @andrewtelnov !

@andrewtelnov
Copy link
Member

@willgdjones The bug has been fixed in the custom widget repo

Thank you,
Andrew

@willgdjones
Copy link
Author

willgdjones commented Dec 2, 2018 via email

@andrewtelnov
Copy link
Member

@willgdjones We will release a new version and update NPM very likely on Tuesday. I have just found another bug and have fixed it. It is related to renderAs property. Unfortunately, you would have to rebuild the surveyjs library as well.

Thank you,
Andrew

@willgdjones
Copy link
Author

Thanks!

@andrewtelnov
Copy link
Member

@willgdjones The new update is released. It should be fine now.

@willgdjones
Copy link
Author

Thanks for updating - I'm actually getting a Component survey is already registered error in my console. This might be unrelated to the original issue though. Is there a standard way to integrate Survey with Vue? We have currently been working off this example: https://github.com/surveyjs/surveyjs_vue_quickstart

@willgdjones
Copy link
Author

Ok - I can confirm that it seems to have been introduced in 1.0.59 somehow! It occurs when I use both SurveyVue and Survey Editor. Let me know if I can provide further details. Thanks for all your help!

@tsv2013
Copy link
Member

tsv2013 commented Dec 4, 2018

@willgdjones Can you try to remove node_modules and then reinstall them via npm i command?

@willgdjones
Copy link
Author

Ok - I thought I tried that yesterday, but I just tried it now and it worked - so thank you!

@willgdjones
Copy link
Author

I'm still getting the same errors as before, here are the package versions I have.

"select2": "^4.0.6-rc.1",
"survey-knockout": "1.0.59",
"survey-vue": "1.0.59",
"surveyjs-editor": "1.0.59",
"surveyjs-widgets": "1.0.59",

Let me know if there's anything else I need to add.

Thanks,
Will

@dmitry-kurmanov
Copy link
Member

@willgdjones Hello! I've created an example: https://plnkr.co/edit/5tNsJhUNSeuFXgBDs8yk?p=preview and it looks ok for me. Could you please edit it to reproduce the problem?

@willgdjones
Copy link
Author

willgdjones commented Dec 6, 2018

I can confirm that your versions work for me in my application when importing the packages from the various CDNs! Thank you for that. However, when I run a fresh install of my node_modules and import them in the following way:

import "surveyjs-editor/surveyeditor.css";
import * as SurveyEditor from "surveyjs-editor";
import * as widgets from "surveyjs-widgets";

Then I get the error that I had before. This is importing the files within a component of mine, and so I must be doing so incorrectly. Are there best practices for importing the necessary dependencies from inside a component itself? Thanks for your help. I have checked and the SurveyJS dependences are all version 1.0.59.

@willgdjones
Copy link
Author

I'm still having issues :(

@dmitry-kurmanov
Copy link
Member

@willgdjones could you please check our quickstart repo: https://github.com/surveyjs/surveyjs_vue_quickstart/blob/master/src/components/SurveyEditor.vue ? May be it will help.

@willgdjones
Copy link
Author

Yep, that's the example we were working off. :/ We'll take a further look over the weekend but for now we'll just import the packages via the CDN.

@dmitry-kurmanov
Copy link
Member

Yep, that's the example we were working off. :

@willgdjones oh I am sorry I've missed it.

@willgdjones
Copy link
Author

I believe that I've managed to get this working, I needed to import Select2 along with the other packages in the Vue component:

import * as SurveyEditor from "surveyjs-editor";
import * as Select2 from "select2";
import * as SurveyKo from "survey-knockout";
import * as widgets from "surveyjs-widgets";

@dmitry-kurmanov
Copy link
Member

@dexp-io
Copy link

dexp-io commented Apr 10, 2019

I get it work by downgrade to 1.0.71 version.

@andrewtelnov
Copy link
Member

@nguyencongt3 It works fine with the latest version. I have made several example several days ago.
The latest version is v1.0.78 and we have just released v1.0.79

Thank you,
Andrew

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants