Issue #612πŸ’¬ AnsweredOpened December 6, 2017by vishal50330 reactions

Urgent : Duplicate other blocks when used custom asset manager

Quick answerby artf

If you get duplicate components only when using your custom Asset Manager, well you should check how you assign the src, I can't help you more

Read full answer below ↓

Question

Code SnippetTEXT
Hello, 
We have modified the Assset manager with custom one. But we are having problem now. If we drop one image into canvase and then add any other component , it will duplicate that component. If we add another image then it would triplet other component.

Can you please help us.
Below is the code snippet that we have used to open our custom asset manager.

editor.Commands.add('open-assets', {
        run: function (editor, sender, opts)
        {
            var classofelement = opts.target.attributes.property == "background-image" ? "wrapper" : opts.target.cid;
            AjaxRequestStart();
            $.ajax({
                url: '@Url.Action("FilesForm", "File")',
                type: 'POST',
                dataType: "html",
                contentType: "application/json; charset=utf-8",
                data: JSON.stringify({ classOfSelectedElement: classofelement }),
                success: function (result) {
                    editor.Modal.open();
                    $("#gjs-mdl-c").html(result);
                },
                error: function (err, xhr, thrownError) {
                },
                complete: function () {
                    AjaxRequestEnd();                    
                }
            });

        }
    });

Answers (2)

artfβ€’ December 8, 2017

If you get duplicate components only when using your custom Asset Manager, well you should check how you assign the src, I can't help you more

lock[bot]β€’ September 18, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Related tutorials

In-depth guides on the same topic.

All tutorials β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.