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 init with blocksUrl #44

Open
nqtuyen opened this issue May 29, 2020 · 2 comments
Open

Error when init with blocksUrl #44

nqtuyen opened this issue May 29, 2020 · 2 comments

Comments

@nqtuyen
Copy link

nqtuyen commented May 29, 2020

pls help me. Thanks!

jquery.brickyeditor.js:426 Uncaught (in promise) TypeError: blocks.forEach is not a function
at Editor.loadBlocks (jquery.brickyeditor.js:426)
at Editor. (jquery.brickyeditor.js:335)
at step (jquery.brickyeditor.js:31)
at Object.next (jquery.brickyeditor.js:12)
at fulfilled (jquery.brickyeditor.js:3)

@yakovlevga
Copy link
Owner

Hi, could you, please, provide the config you use during plugin initialization.

@nqtuyen
Copy link
Author

nqtuyen commented Jun 3, 2020

Hi, this is my config. pls give me your solutions, thank you so much!
I use it in ASP.NET MVC projects.
I store datajson to db and reload when edit.

$("#editor").brickyeditor({
templatesUrl: "/design/templates/",
blocksUrl: '/design/datajson/@Model.Id',

        onload: function (editor) {
            $("#renderHtmlBtn").on("click", function () {
                var html = editor.getHtml();
                $('#renderHtml').val(html);
            });
        },
        onChange: function (blocksJson, blocksHtml) {
            $('#renderHtml').val(JSON.stringify(blocksJson));
        }
    });

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