-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Drag drop builder for ASP mvc core 8 / 9 LTS #372
Comments
Thank you for the C# example.
The editor only exports the page html it does not export other states like changed component properties or assets. If you want to save page assets like images, css, javascript files you can check the jszip plugin code https://github.com/givanz/VvvebJs/blob/master/libs/builder/plugin-jszip.js#L29-L43 that gets all page assets and generates a zip file with the page and all assets. |
ok thanks, I need some help and I can map it on my own, and share if you want. I need to store newly created forms in the Vvvebjs as tables, and table data. how do I get the table/div or dom structure as a json object for the user created forms, so that I can save the fields of the form in a table. My plan is to auto script (new table, from form Json structure, date, text, input etc), the save user data from the forms. |
You can use Vvveb.Builder.frameBody.querySelectorAll("form").forEach(f => {
console.log( JSON.stringify(Object.fromEntries(new FormData(f))) );
}); |
Hello @givanz , sorry for the delay I was able to capture this on the backend, I also put a version number to let user update their forms. They can use this code in any web app or mobile app or even CMS.
but when we get the form back from DB, if i display on browser, how does the builder know which components correspond to which icons in the drag drop, if the user wants to edit a previous form. Also how to extend with other icons, like user wants add something like apex charts, https://echarts.apache.org/examples/en/index.html in my use case the user creates the HTML, and then I have add the C# data models back to it |
Hi Components can match page elements by tag name, class or attributes. For custom components a convention with
https://github.com/givanz/VvvebJs/wiki/Components#component-definition You can adapt the existing chartjs component to work with apex charts https://github.com/givanz/VvvebJs/blob/master/libs/builder/components-widgets.js#L626 You can add new components with Vvveb.Components.extend("_base", "mygroup/mycomponent1", {
nodes: ["img"],
name: "Image",
html: '<img src="../libs/builder/icons/image.svg" height="128" width="128">',
image: "icons/image.svg",
properties: [{
name: "Image",
key: "src",
htmlAttr: "src",
inputtype: FileUploadInput
}, {
name: "Width",
key: "width",
htmlAttr: "width",
inputtype: TextInput
}, {
name: "Height",
key: "height",
htmlAttr: "height",
inputtype: TextInput
}, {
name: "Alt",
key: "alt",
htmlAttr: "alt",
inputtype: TextInput
}]
}); then add the component to a group Vvveb.ComponentsGroup['Mygroup'] = ["mygroup/mycomponent1", "mygroup/mycomponent2"]; |
Hello I have managed with some help, but need to persist as structured content so its easy to recreate and version the pages like wordpress in our .net core CMS.
I think this will also help others, but its just an initial cut, I wanted to get the richer structured aspects of the content like imaged and formatting capture/rendered/options etc stored, can you you please help. I will make it a nuget package
//Index.cshtml
The text was updated successfully, but these errors were encountered: