Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create dynamic drag and drop templates?

I have a requirement of developing a functionality where user can dynamically define a template (labels, textboxes, labels, rows, columns, parent child relationships among above elements etc). These elements(such as combo boxes) may be bound to different database tables.

For example, the user may define a template T1 for a specific use case U1. But this template is not restricted to U1 only. It may be needed to be used in another use case U2, where it is a sub part of a bigger template.

Once the templates are defined, another user may load the templates (HTML form) and enter data into it. At a later stage, I need to reuse this data and template to generate PDF reports. Since PDF reports may sometimes need to have a different layout than the HTML form, I would need parent child relationships between elements as well.

As of now, we are achieving by generating an XML from a user interface where a user can select elements from a dropdown and specify properties. At run time, these XML are transformed to HTML using XSLT. Another XSLT is used for generating PDFs. The limitation of this scheme is that it is very tedious to incorporate any user requests (such as multiple columns, add tables into forms etc).

I was wondering how other people achieve this and is there an API/Library for doing the same ? I have looked at HTML5 and JQuery drag and drop features, but it would require me to add everything from scratch (such as dynamically add columns,rows etc.)

like image 867
krammer Avatar asked Jun 24 '15 06:06

krammer


People also ask

How do I create a drag and drop template?

To create a drag and drop template, open the Design Manager and in the finder, create a new file, choose a template, and the type of template you're creating. Drag and drop templates are made up of building blocks, these blocks are modules, groups, global groups, and flexible columns.

What is a drag and drop template?

The Drag & Drop editor allows you to create templates by dragging and dropping design elements onto your template so that they appear in the order you would like them to appear. This allows you to quickly design templates without the need to be familiar with HTML.

How do I change the drag and drop template on HubSpot?

You cannot switch a coded template with drag and drop editing to a layout template or a coded template without drag and drop editing. To swap out your template, click Use different template. In the dialog box, select the template you want to use for the page and click Select this template.

What is module in HubSpot?

Modules are reusable components that can be used in templates or added to pages through drag and drop areas and flexible columns. In addition to using the modules that HubSpot provides, developers can create their own modules for everything from testimonials to photo galleries.


1 Answers

The best thing to create dynamic form is using angular js. It is very good framework for front end development

Here is the working link for angular js form

Sorry, I only gave example form dynamic forms here are some example for drag and drop Angular drag and drop 1

Angular drag and drop 2

http://angular-js.in/dragular/

I hope this will help.

like image 99
Sen Avatar answered Oct 23 '22 11:10

Sen