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

continuousNodeArray is undefined #9

Open
mkgn opened this issue May 17, 2018 · 7 comments
Open

continuousNodeArray is undefined #9

mkgn opened this issue May 17, 2018 · 7 comments
Labels

Comments

@mkgn
Copy link

mkgn commented May 17, 2018

I am trying out the latest surveyjs with (Angluar 5, aspnet.core in Aspnetboilerplate template). Below are few issues that pops up which I think is not related to the integration with aspnetboilerplate.

  1. When I navigate to the route with the component it loads the editor but in console it says:
    "unable to process binding "template: function(){return { name:'objecteditorproperty',afterRender:$parent.koAfterRender} }" window.CKEDITOR is undefined.
    So this may be because of missing CKEditor? is it a must to have CKEditor?

  2. I add a control to the designer and click the delete button and the console gives the below error
    "TypeError: continuousNodeArray is undefined"

  3. when you play around with control options the console logs
    "TypeError: this.koSelectedObject(...)" // I have knockout 3.4

Basically these were the main errors i encountered. Because of this I couldn't test other features since they don't work.

@tsv2013
Copy link
Member

tsv2013 commented May 17, 2018

It's hard to say what caused this errors without a code.
CKEDITOR it not necessary for SurveyJS Editor. If you took code from this repo, the CKEDITOR is included here as a part of custom widgets demo.

@mkgn
Copy link
Author

mkgn commented May 17, 2018

Well, removing the questions seems to be the only thing that doesn't work. The stack trace is attached.
surveyjs-error.txt

Any insight to troubleshoot will be much appreciated.

@tsv2013
Copy link
Member

tsv2013 commented May 18, 2018

In this stack I found editor code that executes ok on our site in the editor (https://surveyjs.io/Survey/Builder/). But on our site it is not wrapped with Angular. Can you provide a working sample to investigate?

@mkgn
Copy link
Author

mkgn commented May 18, 2018

Ok got it fixed. Nothing wrong with your code or mine. Just changed some configurations.

  1. commented out registering the ck-editor.
    //SurveyEditor.SurveyPropertyModalEditor.registerCustomWidget("html", CkEditor_ModalEditor );
    This is because I don't have the ckeditor plugin at this moment.
    This solved: "TypeError: continuousNodeArray is undefined" & "TypeError: this.koSelectedObject(...)" errors. Now I can delete questions from the canvas!!! Werid how things break!

2)Then i got TypeError: jsonObj.pos is undefined error and for that I commented out
//this.editor.text = JSON.stringify(this.json); since I don't have a default json for a form.

Only thing that doesn't work now is : this.editor.saveSurveyFunc = this.saveMySurvey;
this doesn't seem to call the method. As I understand this should fire when user press [complete] button right? When testing the survey, the [complete] button just take me to "Thank you for completing the survey!" message.

@mkgn
Copy link
Author

mkgn commented May 18, 2018

The problem of saving is that the method signature should be;
saveMySurvey = (saveNo, callback) => {
console.log(JSON.stringify(this.editor.text));
//this.surveySaved.emit(JSON.parse(this.editor.text));
};

If you have;
saveMySurvey = () => {
console.log(JSON.stringify(this.editor.text));
//this.surveySaved.emit(JSON.parse(this.editor.text));
};

it doesn't work.

@tsv2013
Copy link
Member

tsv2013 commented May 18, 2018

@mkgn I'm doubt a method signature affects method call. I beleive the real cause is another.

@mkgn
Copy link
Author

mkgn commented May 23, 2018

There is another strange behavior( I feel) which I cannot explain. If you want you can try it and see whether it happens to you as well.

In survey.editor.component.ts file in the ngOnInit(){

    this.editor.saveSurveyFunc = this.saveMySurvey;
    //this.editor.isAutoSave = true; //move this line above saveSurveyFunc and it won't show the [save] button

}

As I have commented above, if you move that line before saveSurveyFunc() it won't show the save() button. I was scratching my head for sometime.

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

No branches or pull requests

2 participants