Issue #1487💬 AnsweredOpened October 8, 2018by Skovmissen0 reactions

Load from Database

快速解答by Skovmissen

@artf Im stuck could you maybe help me out?

Read full answer below ↓

Question

代码片段TEXT
I've got an issue with loading the lory-slider from my mysql db. When i load it back in, the functionality is gone, i cant slide left or right.
here is my save code:
` var cmdm = editor.Commands;
cmdm.add('save-db', {
  run: function (em, sender) {
    
    
    sender.set('active', true);
    //get full HTML structure after design
    //var InnerHtml = this.frameEl.contentDocument.activeElement.innerHTML;
    var InnerHtml = editor.getHtml();
	var css = editor.getCss();
	console.log(editor);
    //set post to save all HTML structure after design to DB
    $.post("savetoDB.asp", { html: InnerHtml, css: css  }, function (result) {
		console.log("Saved to db");
      sender.set('active', false);
    }).fail(function(fail){
		console.log(fail.responseText);
		 sender.set('active', false);
	});  }}); 

and load which is converted from string to JSON format, im using asp classic so thats why its looking a bit weird:

`response.write "{""gjs-css"":""" & css &""", ""gjs-html"":"""&""& html&""&"""}"`

What i can see is that the data-gjs-type is sat to default on load, where as a new slider have data-gjs-type = "lory-slider"

Answers (3)

SkovmissenOctober 9, 2018

@artf Im stuck could you maybe help me out?

SkovmissenOctober 12, 2018

Thanks i solved it.

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.