Issue #911Opened February 28, 2018by rajatkumcom0 reactions

Could some one please help me with Custom Load.

Question

What I can use instead of followings-

editor.setHtml( arr_data['html'] ), editor.setCss( arr_data['css'] ),

In below code.

Answers (3)

rajatkumcomFebruary 28, 20180 reactions

Below is my code:-

editor.Commands.add( 'load-command', {
        run(editor, sender) {

            editor.load(() => {
                sender.set('active', 0);
            });

    		var arr_html_data = {};

    		arr_html_data['nid'] = 65;
    		arr_html_data['content_type'] = "";
    		arr_html_data['op'] = "loadContent";

            $.ajax({
    			url: DrupalBasePath + '/landing/joperation/1',
    			method: "POST",
    			data: JSON.stringify( {
    				'op' : "loadContent",
    				'request': arr_html_data,
    			} ),
    			dataType: "json"
    		}).done(function( data ) {
    		    alert( "Data has been loaded successfully." );
    		    var arr = $.map(data, function(el) { return el });
    		    var arr_data = JSON.parse( arr[0]['data'] );
    		    console.log( editor );
    		    editor.setHtml( arr_data['html'] ),
				editor.setCss( arr_data['css'] ),
//				arr_data['assets'] = editor..getAll();
				editor.setStyle( arr_data['style'] ),
				editor.setComponents( arr_data['components'] );
    		    
    		});
        },
    },
);

What I can use insted of followings- editor.setHtml( arr_data['html'] ), editor.setCss( arr_data['css'] ),

Thanks in Advance.

artfMarch 2, 20180 reactions

Just don't use them for loading your template data

editor.setStyle( arr_data['style'] ),
editor.setComponents( arr_data['components'] );

is all what you need

rajatkumcomMarch 2, 20180 reactions

Thank you....

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.