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

Get Changes as JSON from edior in grapejs #57

Closed
desilvaNSP opened this issue Mar 21, 2017 · 2 comments
Closed

Get Changes as JSON from edior in grapejs #57

desilvaNSP opened this issue Mar 21, 2017 · 2 comments
Labels

Comments

@desilvaNSP
Copy link

desilvaNSP commented Mar 21, 2017

Basically I am using json configs to keep attributes of each UI component of the template.Following is the configs that I kept.


{
	"registration": {
		"form": "signup-form",
		"fields": [{
			"id": "signup-input-username",
			"name": "input-username",
			"label": "User name",
			"type": "text",
			"placeholder": "This is test username"
		}, {
			"label": "Password",
			"id": "signup-input-password",
			"name": "input-password",
			"type": "password",
			"placeholder": "This is password"
		}],
		"controls": {
			"submit": {
				"id": "btn-signin-form",
				"name": ""
			},
			"cancel": {
				"id": "",
				"name": ""
			}
		}
	}
}

In this case, I create my registration form dynamically from that config json.And that form html load into the grapejs editor.and change whatever thing we want through the grapejs editor.
And As example, I want to change label name and save it as html. BTW I want get those changes into my config json. It goes trouble to me becuase I only know to get editing changes as html using getHTML() method in grapejs.

If there any capability to get those changes into (outside as json) my configs without html

Appreciate your help.

Thanks
sandun.

@artf
Copy link
Member

artf commented Mar 24, 2017

Have you tried using editor.getComponents()? This method returns JSON representation of components

@artf artf closed this as completed Mar 28, 2017
@lock
Copy link

lock bot commented Sep 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.

@lock lock bot added the outdated label Sep 18, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Sep 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants