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

Error when loading dynamically #11

Open
kpirbhai opened this issue Aug 26, 2016 · 3 comments
Open

Error when loading dynamically #11

kpirbhai opened this issue Aug 26, 2016 · 3 comments

Comments

@kpirbhai
Copy link

I'm trying to load the editor dynamically and getting a "Failed to load a file" error from qcubed.js line 439.

I haven't been able to figure out which file isn't loading. This happens every time on Chrome and IE but on FF, if I reload the page and then click on the button which dynamically loads the QPanel which the Ckeditor lives one...then the file is loaded.

After trying to do a bunch of digging...it seems that the ckeditor/adapters/jquery.js file is throwing an error which is then being bubbled up to QCubed. The error is "CKEditor should be loaded before CKEditor jQuery adapter". The file is minified but when using the "pretty" function in Chrome it is on like 8.

I'm going to keep trying to make this work but was hoping someone else would have some insight.

The files are being referenced in the proper order in the QCkeditor plugin....or at least it seems that way to me. I'm thinking maybe qcubed loads the list of js files to add through ajax in some different order?

Any hints in the right direction would be much appreciated. I really suck a javascript.

@spekary
Copy link
Member

spekary commented Aug 27, 2016

When you say you are loading ckeditor dynamiccally, what do you mean?

@kpirbhai
Copy link
Author

I made a control which is a QPanel. That QPanel has a "view" and "edit" state. The view state is a QPanel which displays just html and an edit button. When you click the edit button the QPanel with the Html is replaced with a Panel containing the CkEditor.

So basically the CkEditor is being generated through an Ajax call.

Here's where the error is occurring:
image

@spekary
Copy link
Member

spekary commented Aug 29, 2016

CKEditor is a pretty big javascript application and may not respond well to ajax loading. Instead of "replacing", can you instead just set Visible to true on it, and set Visible to false on the other things. Doing it that way will cause all the CKEditor javasacript to be loaded when the page loads.

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

No branches or pull requests

2 participants